[mobile:Android] mobileSetAllowedOrientations gives error

J. Landman Gay jacque at hyperactivesw.com
Fri Jun 3 12:02:10 EDT 2011


On 6/3/11 10:10 AM, Nonsanity wrote:
> Am I wrong in thinking this command doesn't exist unless the stack is
> running in a mobile environment? In other words...
>
> on preOpenStack
>      if the environment is "mobile" then
>          mobileSetAllowedOrientations "portrait"
>      end if
> end preOpenStack
>
> ...Will prevent errors when running in the IDE on Windows or Mac, but will
> limit the orientations to portrait-only when running on iOS or Android..?

Yes, I'm sure that's the problem. (Roger, don't use parens, it's a command.)

> Personally, I'd prefer the language to skip over such commands gracefully
> instead of crashing the script when the environment is wrong. Otherwise the
> programmer has to encase every such command in an environment check.

Agreed, it's a pain. It's a little quicker to write a custom function 
and call that, though not by much:

function mob
   return the environment = "mobile"
end mob

Then all you have to write is: if mob() then...

But still, we shouldn't have to.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list