05-05-2010, 11:41 PM
Clear does NOT restore the DATA! If you have several DATA fields you can name them andv RESTORE the ones you need.
To name a DATA field use a line label:
MyData1:
DATA ,,,,,,,,,,
DATA ,,,,,,,,,,,
DATA ,,,,,,,,,,
When you READ the DATA you can restore that data field only:
RESTORE MyData
FOR i = 1 TO 20Â 'read 40 values using 2 variables
READ nam$, age%, address$
NEXT
I advise placing all DATA fields after the main program code has ended. That way, you don't accidentally go to the wrong DATA fields.
To name a DATA field use a line label:
MyData1:
DATA ,,,,,,,,,,
DATA ,,,,,,,,,,,
DATA ,,,,,,,,,,
When you READ the DATA you can restore that data field only:
RESTORE MyData
FOR i = 1 TO 20Â 'read 40 values using 2 variables
READ nam$, age%, address$
NEXT
I advise placing all DATA fields after the main program code has ended. That way, you don't accidentally go to the wrong DATA fields.
Get my QB demonstrator here: http://dl.dropbox.com/u/8440706/Q-Basics.zip