Bernard
09-09-2000, 08:36 AM
I am trying to complete an student project. I have to design a form and place on it several combo and list boxes. I then have to add data using things like combo1.additem routines. I am required to be able to save the data that has been entered into each combo and list box field. Then I must be able to open the saved file and the saved data must go back into the relevant combo or list box. Can anyone help with the coding for this one. Any and all help will be appreciated.
Regards
Bernard
DWard
09-09-2000, 02:14 PM
The fastest way to do it would be to dump the data into a sequencial file.
Open "C:Data.txt" for Output as #1
For x=0 to lstBoxt1.ListCount-1
Print#1,lstBox1.Linstindex(x)
Next
close #1
To retreive the data
Open "C:Data.txt" for Input as #1
For x=0 to lstBoxt1.ListCount-1
Line Input #1, a
lstBox1.Additem a
Next
close #1
Very basic but it will work.
Hope it helps !
Eagle
09-09-2000, 02:37 PM
I'd agree, or if you want to be able to select specific items to add, use a random access file. This way you can add several combo boxes info to one file and retrieve it with ease.
DWard
09-09-2000, 02:45 PM
Another thing worth trying may be to prefix the data in the file with the name of the Listbox and seperate it with a comma.
lstBox1,ABCDEFG
lstBox2,HIJKLMNO
lstBox3,PQRSTUV
And then when you retreive the data search for the comma and then point the data to the right ListBox, the advantage of this is that it is still simple and you can put all the data in one file.
usetheforce2
09-10-2000, 12:28 PM
Hey Bernard,
Check attachment, made a little demo to demonstrate what your looking for
Regards
Regan DeDiana
Bernard
09-13-2000, 02:34 PM
Thank you every one for your help so far. I am still working on this one. Any additional view points would be appreciated.
Regards to all
Bernard