Page 1 of 1

Native text field inhibits IDE

Posted: Thu Mar 29, 2012 7:44 am
by grovecat
I create a native text input on my opening card inside the on OpenCard script, and I delete it via the on CloseCard script. The deletion is necessary to stop the field contents showing on other cards.

When the card opens, the IDE generates an error, which I can ignore. However, when I go to move to another card, the IDE won't let me because of the delete control error. So I have to comment out the iPhoneControlDelete command until I have finished editing, then remember to activate it again to give the correct performance on the iPad when I generate the Standalone app.

I thought that checking the Hide Errors box in Preferences may stop the behaviour but it does not. So the question is -- How can I stop the IDE from choking on the iPhoneControlDelete command?

TIA
Don

Re: Native text field inhibits IDE

Posted: Thu Mar 29, 2012 8:14 am
by bn
Hi Don,

enclose your code in a conditional "if the environment is "mobile" then"

example

Code: Select all

on opencard
   if the environment is "mobile" then
      -- do your mobile specific initializations
   end if
   -- more code if needed
end opencard
likewise in all other handlers that address mobile specific stuff, in your case on closeCard

Kind regards

Bernd

Re: Native text field inhibits IDE

Posted: Thu Mar 29, 2012 8:27 am
by grovecat
Thanks Bernd

Works perfectly (of course).

Cheers
Don