I have a program almost ready to post. One problem I can't solve. I want to save the contents of a textbox to a file.
How do I extract the text from the textbox into a variable?
I create a textbox
c = #.textbox
c.edit = 1 'text box is an editable text field for text input;
c.height = 400
multi = 1
The user enters some note text. When they press Save, I call
k = "Notes.txt"
#.writetext(k,c)
That produces an error, since c is an object, not a string. How do I get the string the user entered into object c, to save into the file "Notes.txt"
Help needed
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Help needed
The only thing that gets me down is gravity...
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Help needed
The text is in c.text
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Help needed
Thanks. I knew that I could put text into the textbox with c.text. I didn't realize I could also extract it that way. That info would be worth a mention in the manual Interface section. I will post the program now.
The only thing that gets me down is gravity...
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Help needed
Yes, in SPL the UI object groups like #.button or #.textbox have interactive properties - they reflect changes in and out.