-
Content Count
99 -
Joined
-
Last visited
Community Reputation
1 NeutralRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Thanks Stano, I took your advice and sorted the List alphabetically. Previously the items in the Listbox was in the same order as the database except that, record 1 in the database was position 0 in the Listbox. When a record was selected I added 1 to the position in the Listbox and that corresponded to the correct record in the database. When the Listbox was sorted, the positions in the Listbox did not align with the record number in the database, so I used the name selected in the Listbox and searched the name field in the database. That works fine. If the Listbox is used there will not be any typo errors. Here is a link to the sorted version. Sorted Version
-
Thanks Gary, I will store this away for future use.
-
Thanks Gary, I will store this away for future use.
-
Ok, I was just going to send another link to the latest fixed version. I won't have to now. 🙂 Thanks for all of your help and encouagement Gary. Merry Christmas and hope you have a great 2024.
-
I thought that I had fixed that. I used: [procedure TfrmDino.FormCreate(Sender: TObject); //Form creation begin conPLife.Params.Database := IncludeTrailingPathDelimiter(TDirectory.GetCurrentDirectory) + conPLife.Params.Database; conPLife.Connected := True; tblPLife.Active := True; lbxData.Visible := False; end; In the conPLife under Params I have Database set as dino. Should I clear that and do it in the code? Thanks Gary. It is a program that I wrote a few years back and I used it as a learning process for Purebasic and then again in Python so I now have 3 different versions of this program. 🙂
-
That was it! I should have caught that the quote was missing. I must be blind. Actually I am going for cataract surgery next month. lol Thanks Gary.
-
Hi Stano, I tried you suggestion: The app runs but as soon as I select a name in the Listbox I get an error. [FireDAC][Stan][Eval]-100 Column of function [frmDino] is not found.
-
Merry Christmas to all. I am trying to make a change to the app to use the Locate() Function but I am having a problem with the proper syntax. My understanding from what I see in the docs and other data, it is Locate(name of field, what to find, []); but I keep getting an 'Undeclared Identifier Locate' error. I tried using tblPLife.Locate(name of field, what to find, []); but while the Undeclared Identifier error goes away and the app runs, as soon as I select an item in the Listbox I get a 'Column or Function not found' error. Here is the code that I was trying: procedure TfrmDino.lbxDataClick(Sender: TObject); iSelect: Integer; begin If lbxData.ItemIndex > -1 then begin iSelect := lbx.ItemIndex; sName := lbxData.Items[iSelect]; tblPLife.Locate(name, sName, []); //name is the column and sName is what I want to find. end Else ShowMessage('Nothing Selected'); end;
-
@Stano, I appreciate the critique. The image is not large enough for me to read it properly so I'm not sure what is wrong with the app being maximized when run. I am not trying to be nasty or anything but what difference does it make if it is in lowercase? Just curious as to the reasoning. They are not really random. They are in the order of the era that they lived starting from when life first evolved up to when humans arrived.
-
I made a couple of changes to my application and I think it is ok now. Not the best coding but it works and the improvements should come with further practice. There are a few things in Delphi that bugs me, like making it such a task to get rid of the Titlebar and the Delphi icon. I have given up on that for now but the app looks terrible with a brown and cream color scheme and a Blue titlebar. If you could at least change the color from blue to brown to match the rest of the app it would be better but that seems to be impossible as well in Delphi. But, I sincerely thank everyone for their help and patience. You can get the finished version here.
-
Wow! It's getting more and more confusing. Anyway, I think that I have it working now however, there is still one problem that bothers me and that is the titlebar. I want my header image to be at the very top when the application runs. In design mode it is at the very top and no Delphi titlebar. When I compile it to an .exe the Delphi titlebar appears at the top with the Delphi logo and my header image is pushed down 30px. Anyway to get rid of the Delphi titlebar?
-
Jon, In my code everything was working but as soon as I set connected to 'False' and do a build, the .exe can't find the images. If I go back and change the 'Connected' to true and try to run it from within design mode it can no longer find the images in design mode either. Also, when using your code, when I select a animal from the Listbox it is not getting the correct record. If I select record 9, I get record 8. I did understand that the index starts at 0, and that is why I used the iSelect := lbxData.ItemIndex +1; so iSelect would match the record number in the databse. In the database, Cephalaspis is record number 6. Using your code, if I select Cephalaspis in the Listbox I get record number 5, Megalograptus.
-
Hmmmm, I checked the params in the TFDConnection component and it had the full path to the database so it is hard coded. I tried putting just the database name (dino.db) thinking that it would look in the current directory for the file but doesn't work. It then flags an error that my images cannot be found as well. The path for the images is dino_images.Picture.LoadFromFile('dino_Images\ ' + sName + '.jpg'); dinoSize.Picture.LoadFromFile('dino_Images\ ' + sName + '_size' + '.jpg') so it should be able to find them from in the current directory. I zipped the entire project but it is too big to attach here. Try this link.
-
All done! Seems to be working as it should. I have attached a link so you can see what I was doing. Given that it is my first application in Delphi there is probably room for a lot of improvement but it was intended as a learning project. Also, I don't know what screen resolution you are using but this app was for 1280 x 720. I removed the link for now.
-
I suppose there has been some kind of confusion. I am probably not making myself clear in my posts. I had created my own buttons and they worked well as did my search box. Then you said that I shouldn't make my own buttons and that I should use the DBNavigator. Gary recommended that I should take your advice and so I agreed. My response to Gary was: So I am now working on making changes to the application to use the DBNavigator. It is working as far as moving back and forth through the records but it is not loading my images. The images are loaded using the contents of the TDBEdit (dbeName) after the record has been retrieved but I am not sure what DBNavigator uses to retrieve the record. I am assuming that it is incrementing or decrementing the record number. I am currently trying to figure out how to resolve this image issue. I will work on that today.