On 2020-04-22 17:00, Graham Samuel via use-livecode wrote:
As usual, the problem will be my fault, but I can’t get a mobile input
field to appear on a card. I’m debugging it at present, which explains
the answer statement:

    on opencard -- we dynamically create a field for the user to key in
     global sinputID -- this is all from the LC lesson. It’s a global
because I need to refer to it in a button later
     if environment() = "mobile" then
mobileControlCreate "input", "FMyText" -- so the user can type in
         put the result into sinputID — the Dictionary doesn’t mention
‘the result’ but it does seem to be right
answer "opening text field for input. ID created is:" && sinputID
        mobileControlSet sinputID, "rect", “114,135,163,158” — this is
a real location on the card
        mobileControlSet sinputID, "visible", "true"
        mobileControlSet sinputID, "opaque", "true"
  end if
end opencard

I'm pretty sure if you give your mobileControl a name (FMyText) in this case, then that is the only way you can refer to it. You can only use 'the result' of the Create function *if* you didn't give it a name.

So you need to do either:

  mobileControlCreate "input", "FMyText"
  mobileControlSet "FMyText", ...

OR

  mobileControlCreate "input"
  put the result into sinputID
  mobileControlSet sinputID, ...

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to