Help needed

Post Reply
User avatar
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: Canada
Contact:

Help needed

Post 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"
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Help needed

Post by Mr. Kibernetik »

The text is in c.text

User avatar
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: Canada
Contact:

Re: Help needed

Post 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.
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Help needed

Post 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.

Post Reply