chrisj051697
asked on
Make a listbox item active from a read in text file
Hi
I have successfuly put together most of my first app and I'm very impressed with this language.
The problem is that I need to be able to read a short text file into a form's components, modify the form and write the text file back out.
I can make this work with TEdit boxes, but when I try to readln a line, I can capture the line but am unable to make it show up in a list box as the highlighted item
line 2 of text file = "USR 28.8 External" I need this to be the active entry in a list box as such
LISTBOX1 STRINGS
Cardinal 28.8 Internal
Cardinal 33.6 External
USR 28.8 External (>THIS NEEDS TO BE THE ACTIVE LINE)
Zoom ~~```` (OF THE LIST BOX)
My second part of my problem is with another list box. I can read a file into it and delete an item from it, but how do I rewrite the remaining lines back out to the original file such that the deletede entry is not in the re-writen text file..
Any help would be most appreciated
Thanks In Advance
Chris
I have successfuly put together most of my first app and I'm very impressed with this language.
The problem is that I need to be able to read a short text file into a form's components, modify the form and write the text file back out.
I can make this work with TEdit boxes, but when I try to readln a line, I can capture the line but am unable to make it show up in a list box as the highlighted item
line 2 of text file = "USR 28.8 External" I need this to be the active entry in a list box as such
LISTBOX1 STRINGS
Cardinal 28.8 Internal
Cardinal 33.6 External
USR 28.8 External (>THIS NEEDS TO BE THE ACTIVE LINE)
Zoom ~~```` (OF THE LIST BOX)
My second part of my problem is with another list box. I can read a file into it and delete an item from it, but how do I rewrite the remaining lines back out to the original file such that the deletede entry is not in the re-writen text file..
Any help would be most appreciated
Thanks In Advance
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
With part 1, I was getting a type mismatch error in the "if" staement. Put this looks like is does the job. I'll have to figure out what I was doing wrong
For part two, I was playing with "Assign File" routines. This looks much cleaner.
Chris