multiple forms of data in one file
- I have a program I am writing that has text boxes and text editor boxes all on one form, and I want to save the users data to a single file. How do I read in and differentiate the text box data from the data that should go into the text editor boxes?
- Am 06.02.2013 18:26, schrieb Larry Lowe:
> I have a program I am writing that has text boxes and text editor boxes all on one form, and I want to save the users data to a single file. How do I read in and differentiate the text box data from the data that should go into the text editor boxes?I usually save information into a plain text file with an INI extension
in the following format:
Option = Value
For the multi-line text editor you may use the same option multiple
times and print the lines to the text editor while they are read from
the INI file.
The use of the format "option = value" allows handling of file
corruption in a graceful way.
If you only place values into the file and read a fixed amount of data,
you are likely to crash the program by reading in a truncated file,
which results in a "read past the end of file" error.
For an example see "Balls, a Billes clone" at
LB 4.04 Pro ... http://www.libertybasic.com/assist.html
LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe
LB Community Wiki .............. http://basic.wikispaces.com/
LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/
Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC
Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM