Put variable into Android field

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm
Location: USA

Put variable into Android field

Post by shawnblc » Fri Dec 13, 2019 12:34 pm

I'm trying to do somethin like the following, but I keep getting a script error. How would I put something into the Android Field and make it not editable?

Code: Select all

put char 44 to 77 of line 3 of URL "https://domain.com/string.php" into tandroidFld1
answer tandroidFld1
put tandroidFld1 into widget "androidFld1"
Here's the error.

Code: Select all

Type	Chunk: destination is not a container
Object	Navigation Bar
Line	put tandroidFld1 into widget "androidFld1"
Hint	hiliteChanged

Klaus
Posts: 13858
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Put variable into Android field

Post by Klaus » Fri Dec 13, 2019 12:44 pm

Hi Shawn,

well, an URL is no container in the LC sense like a variable or field.
You need to load the URL first, then do the rest:

Code: Select all

...
## This should do the trick:
put URL "https://domain.com/string.php" into tURLContent
put char 44 to 77 of line 3 of tURLContent into tandroidFld1
answer tandroidFld1
put tandroidFld1 into widget "androidFld1"
...
Best

Klaus

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm
Location: USA

Re: Put variable into Android field

Post by shawnblc » Fri Dec 13, 2019 2:12 pm

Same error. Still plugging away.

Klaus
Posts: 13858
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Put variable into Android field

Post by Klaus » Fri Dec 13, 2019 2:32 pm

Did you check "Internet" etc. in the "Standalone Application Settings" for your Android App?

And what does THE RESULT tell you:

Code: Select all

...
put URL "https://domain.com/string.php" into tURLContent
if the result <> EMPTY then
  answer "Error:" & CR & the result
  exit to top
end if
put char 44 to 77 of line 3 of tURLContent into tandroidFld1
answer tandroidFld1
## put tandroidFld1 into widget "androidFld1"
## See below for correct syntax
...
AH! Completely overlooked this one, that is not the correct syntax for the widget!

Code: Select all

...
answer tandroidFld1
## put tandroidFld1 into widget "androidFld1"
set the text of widget "androidFld1" to tandroidFld1
...
I repeat: The dictionary is your friend! 8)

Post Reply

Return to “Android Deployment”