Page 1 of 1

Help needed

Posted: Fri Sep 15, 2017 9:05 pm
by rbytes
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"

Re: Help needed

Posted: Fri Sep 15, 2017 9:10 pm
by Mr. Kibernetik
The text is in c.text

Re: Help needed

Posted: Fri Sep 15, 2017 9:22 pm
by rbytes
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.

Re: Help needed

Posted: Fri Sep 15, 2017 9:36 pm
by Mr. Kibernetik
rbytes wrote:
Fri Sep 15, 2017 9:22 pm
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.
Yes, in SPL the UI object groups like #.button or #.textbox have interactive properties - they reflect changes in and out.