how can i do save&load field text?
Posted: Sun Jul 19, 2015 8:23 am
hello
how can i do
save, load, and view field text(multiline)?
example source is here
'example
DIM box$(1)
box$(0)="mltext"
FIELD box$(0) TEXT "" AT 10,100 SIZE 300,200 ML
BUTTON "saveload" TEXT "saveload" AT 10,10
LOOP:
IF BUTTON_PRESSED ("saveload") THEN GOTO SAVE
GOTO LOOP
SAVE:
filenames$="test.txt"
FILE filenames$ WRITELINE FIELD_TEXT$(box$(0))
LOAD:
FILE filenames$ SETPOS 0
FILE filenames$ READLINE FIELD_TEXT$(box$(0))
VIEW:
FIELD box$(0) TEXT "" AT 10,10 SIZE 300,200 ML
how can i do
save, load, and view field text(multiline)?
example source is here
'example
DIM box$(1)
box$(0)="mltext"
FIELD box$(0) TEXT "" AT 10,100 SIZE 300,200 ML
BUTTON "saveload" TEXT "saveload" AT 10,10
LOOP:
IF BUTTON_PRESSED ("saveload") THEN GOTO SAVE
GOTO LOOP
SAVE:
filenames$="test.txt"
FILE filenames$ WRITELINE FIELD_TEXT$(box$(0))
LOAD:
FILE filenames$ SETPOS 0
FILE filenames$ READLINE FIELD_TEXT$(box$(0))
VIEW:
FIELD box$(0) TEXT "" AT 10,10 SIZE 300,200 ML