Crash Course Delphi 12:
|
Acron loads strings from a file![]() Acron, our program that shows a searchable list of acronyms, learns how to load its items from a textfile ;-) We also introduce a better solution for aligning the two columns in the listbox: we set tabulator stops, "tabs". Loading the Items of a ListBox from a fileYou can load the listbow items from a text file with the procedure LoadFromFile,
for example: Of course, this assumes that you have a text file named Acron.dat in the directory c:\delphila\acron02. But wouldn't it be nice if your program could automatically locate that text file, without you having to "hard code" its location? Well, we know for one that the file is located in the same directory as the program's
exe-file. |
|