Saving User-Entered Text

Klaus Major klausimausi at mac.com
Wed Jan 22 04:53:01 EST 2003


Hi Joseph,

> This is so simple, I can't find where I'm going wrong.
>
> I have a field that the user enters some text in. When the stand-alone 
> is closed, the text disappears. How do I get user-entered data to stay 
> in the field when the stand-alone is opened again?
>
> Thanks!
>
> joe.

This is an easy one :-)

1. Make that stack with the field NOT part of the standalone
so it can be saved

or

2. write the field to a file and read it in again when necessary...

on closecard
   put fld "userinput" into url("file:userinput.txt")
end closecard

and:

on opencard
   put url("file:userinput.txt") into fld "userinput"
end opencard

et voila you are in the profesional "preferences writing"-business ;-)
(If you do not change the "directory" somehow in the meantime...)

Hope that helps.


Regards

Klaus Major
klausimausi at mac.com




More information about the use-livecode mailing list