Multiline problems
Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21
-
- VIP Livecode Opensource Backer
- Posts: 70
- Joined: Mon Dec 21, 2009 1:51 am
- Location: Westchester, New York
Multiline problems
Hi John,
I've added a multiline field for Android to my stack. I cannot set the text using mgText or mobileControlSet.
I would like to put the contents of a variable into it then copy it.
But for now, I can't even set the test to anything.
All i get is a blank box. I can input text though, but that doesn't solve my problem.
Example: mobileControlSet "Instruct", "text", tInstruct
Example 2: mobileControlSet "Instruct", "text", "Continue" (this doesn't work either)
To copy: copy the mgText of grp "Instruct"
Are these correct statements? Any idea as to why this is not working? I am running the app on the simulator....
Thanks,
Rob
I've added a multiline field for Android to my stack. I cannot set the text using mgText or mobileControlSet.
I would like to put the contents of a variable into it then copy it.
But for now, I can't even set the test to anything.
All i get is a blank box. I can input text though, but that doesn't solve my problem.
Example: mobileControlSet "Instruct", "text", tInstruct
Example 2: mobileControlSet "Instruct", "text", "Continue" (this doesn't work either)
To copy: copy the mgText of grp "Instruct"
Are these correct statements? Any idea as to why this is not working? I am running the app on the simulator....
Thanks,
Rob
Rob Glassman
ArkStar
ArkStar
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: Multiline problems
Hi, Rob. Two recent examples spring to mind. The first was strange : the control's text wouldn't set unless an empty string was prepended to it;
(http://forums.runrev.com/viewtopic.php?f=54&t=18887)
The normal command wouldn't work, but the following would;
The seconds example was trying to set the text in an openCard handler, but since the openControl message doesn't fire until AFTER openCard, the native control didn't exist yet - we had two alternatives;
use the script of the native input control...
delay setting the native control properties from the openCard handler...
Hopefully, this info will help your situation, but please post again if not!
(http://forums.runrev.com/viewtopic.php?f=54&t=18887)
The normal command wouldn't work, but the following would;
Code: Select all
mobileControlSet "Instruct", "text", "" & tInstruct
use the script of the native input control...
Code: Select all
on openControl
mobileControlSet "test" , "text", "Trial display text"
end openControl
delay setting the native control properties from the openCard handler...
Code: Select all
on openCard
send "mobileSetup" to me in 0 millisecs
end openCard
on mobileSetup
mobileControlSet "test" , "text", "Trial display text"
end mobileSetup
Hopefully, this info will help your situation, but please post again if not!
LiveCode Development & Training : http://splash21.com
-
- VIP Livecode Opensource Backer
- Posts: 70
- Joined: Mon Dec 21, 2009 1:51 am
- Location: Westchester, New York
Re: Multiline problems
Thanks John,
But none of them worked. I now get the control with "tInstruct" in it. I set a breakpoint and tInstruct does contain the proper text.
Here's the code I am using...
put item 8 of line tLineNo of fld "theList" into fld "Instructions"
put the fld "Instructions" into tInstruct
delete char 1 of tInstruct
end preOpenCard
on openCard
send "mobileSetup" to me in 0 millisecs
end openCard
on mobileSetup
if the environment="mobile" then
mobileControlSet "test" , "Instruct", "" & tInstruct
end if
end mobileSetup
-----------------------------------
I also used "set the mgText of group "Instruct" to "" & tInstruct" instead of mobileControlSet. Also, shows "tInstruct"
Any ideas?
Thanks again, Rob
But none of them worked. I now get the control with "tInstruct" in it. I set a breakpoint and tInstruct does contain the proper text.
Here's the code I am using...
put item 8 of line tLineNo of fld "theList" into fld "Instructions"
put the fld "Instructions" into tInstruct
delete char 1 of tInstruct
end preOpenCard
on openCard
send "mobileSetup" to me in 0 millisecs
end openCard
on mobileSetup
if the environment="mobile" then
mobileControlSet "test" , "Instruct", "" & tInstruct
end if
end mobileSetup
-----------------------------------
I also used "set the mgText of group "Instruct" to "" & tInstruct" instead of mobileControlSet. Also, shows "tInstruct"
Any ideas?
Thanks again, Rob
Rob Glassman
ArkStar
ArkStar
Re: Multiline problems
Is tInstruct a local variable that has bee declared at the top of the script?
If it hasn't been declared then of course it won't work
Also,your call to the control to set its text is wrong. mobileControlSet "test" , "Instruct", "" & tInstruct should be:
mobileControlSet "test" , "text", "" & tInstruct
Gerry
If it hasn't been declared then of course it won't work
Also,your call to the control to set its text is wrong. mobileControlSet "test" , "Instruct", "" & tInstruct should be:
mobileControlSet "test" , "text", "" & tInstruct
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: Multiline problems
Gerry's got it
I just reconstructed a stack with your data and everything works OK - let us know if it doesn't - in case there's something else going on!
I just reconstructed a stack with your data and everything works OK - let us know if it doesn't - in case there's something else going on!
LiveCode Development & Training : http://splash21.com
-
- VIP Livecode Opensource Backer
- Posts: 70
- Joined: Mon Dec 21, 2009 1:51 am
- Location: Westchester, New York
Re: Multiline problems
Thanks Guys,
I did exactly what you said. Also, I don't know what happened but i copied in the wrong tex but my statement was correct.
I hadn't declared the local var but it.
No difference. The multiline show tInstruct.
John,
Can you send me your working stack to compare?
Thanks you both for your help! I really appreciate it!
Rob
I did exactly what you said. Also, I don't know what happened but i copied in the wrong tex but my statement was correct.
I hadn't declared the local var but it.
No difference. The multiline show tInstruct.
John,
Can you send me your working stack to compare?
Thanks you both for your help! I really appreciate it!
Rob
Rob Glassman
ArkStar
ArkStar
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: Multiline problems
Rob - test stack attached. I renamed the script local to sInstruct (force of habit!)
LiveCode Development & Training : http://splash21.com
-
- VIP Livecode Opensource Backer
- Posts: 70
- Joined: Mon Dec 21, 2009 1:51 am
- Location: Westchester, New York
Re: Multiline problems
That did it guys!
I also rebooted the simulator.
Thanks again for all of your help!
Rob
I also rebooted the simulator.
Thanks again for all of your help!
Rob
Rob Glassman
ArkStar
ArkStar
-
- VIP Livecode Opensource Backer
- Posts: 70
- Joined: Mon Dec 21, 2009 1:51 am
- Location: Westchester, New York
Re: Multiline problems
OOne more question... sorry...
In Android, can I copy the text of the multiline via commands?
In Android, can I copy the text of the multiline via commands?
Rob Glassman
ArkStar
ArkStar
-
- VIP Livecode Opensource Backer
- Posts: 369
- Joined: Sun Dec 19, 2010 1:10 am
- Location: UK
- Contact:
Re: Multiline problems
Hi, Rob. Glad it's all working. Unfortunately, I think the clipboardData is still only available on desktop platforms, so I don't think copying the text is possible via code
LiveCode Development & Training : http://splash21.com
-
- VIP Livecode Opensource Backer
- Posts: 70
- Joined: Mon Dec 21, 2009 1:51 am
- Location: Westchester, New York
Re: Multiline problems
Hi John,
I got it. I used this code and it copied into memory...
put the text the mgText of grp "Test" into the selectedLines
copy
Thanks again for all of your help
I got it. I used this code and it copied into memory...
put the text the mgText of grp "Test" into the selectedLines
copy
Thanks again for all of your help
Rob Glassman
ArkStar
ArkStar
-
- VIP Livecode Opensource Backer
- Posts: 70
- Joined: Mon Dec 21, 2009 1:51 am
- Location: Westchester, New York
Re: Multiline problems
Hi again,
I don't understand... it worked once. Now it's not.
I don't understand... it worked once. Now it's not.
Rob Glassman
ArkStar
ArkStar
Re: Multiline problems
Hi Rob,
I hope this is a copy/paste error:
...
put the text the mgText of grp "Test"...
...
Best
Klaus
I hope this is a copy/paste error:
...
put the text the mgText of grp "Test"...
...
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Multiline problems
This was a puzzle I once saw
A
Bird in the
the hand is worth
two in the bush
Simon
A
Bird in the
the hand is worth
two in the bush
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!