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 field text?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: how can i do save&load field text?
Command
FILE filenames$ READLINE FIELD_TEXT$(box$(0))
is incorrect - you need to supply variable to read to, like:
FILE filenames$ READLINE t$
Use FIELD TEXT command to set text to your text field, like
FIELD box$(0) TEXT t$
FILE filenames$ READLINE FIELD_TEXT$(box$(0))
is incorrect - you need to supply variable to read to, like:
FILE filenames$ READLINE t$
Use FIELD TEXT command to set text to your text field, like
FIELD box$(0) TEXT t$
Re: how can i do save&load field text?
always thank you!
text load is ok
but
text field is multiline
but load text field is
only one line looks.
text load is ok
but
text field is multiline
but load text field is
only one line looks.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: how can i do save&load field text?
Yes, this command reads file line by line.
There is no command to read all text at once.
There is no command to read all text at once.
Re: how can i do save&load field text?
ok
thankyou very much!
have a nice day
thankyou very much!
have a nice day