Loading ...
Sorry, an error occurred while loading the content.

8212Re: [FlashLite] fscommand2("GetPlatform")

Expand Messages
  • Barry Beattie
    Mar 4, 2009
    • 0 Attachment
      Dale, is there a "trim()" function availble to help here?


      if (trim(fscommand2(“GetPlatform”, “platform”)) == " “Nokia OS" )
      {
      // etc....
      }




      On Wed, Mar 4, 2009 at 3:42 PM, Dale Rankine <dale@...> wrote:
      > Hey everyone, just found a little gotcha when using Device Central CS4
      > (don’t know if this exists in CS3 as well).
      >
      >
      >
      > When you are getting the return value of status = fscommand2(“GetPlatform”,
      > “platform”); for Nokia S40 devices, the string that comes back looks like
      > “Nokia OS”. You might then be checking that value in order to change some
      > conditions in your application, so you might do something like if(platform
      > == “Nokia OS”) ...
      >
      >
      >
      > What isn’t obvious from tracing the variable is that there’s a whitespace at
      > the end of this string (as in “Nokia OS “) and so that test on the absolute
      > value needs to also include the whitespace, otherwise it fails.
      >
      >
      >
      > Returns the same too (with the whitespace) for FL2 and FL3
      >
      >
      >
      > Just came across this doing some development today and just thought I’d
      > share that one with y’all ...
      >
      >
      >
      > Dale.
      >
      >
      >
      >
      >
      > ------------------------------------------------------
      >
      > dale@...
      >
      > www.dalerankine.com
      >
      > Adobe Certified Instructor (Mobile)
      >
      > Certified Flash Lite Developer
      > Adobe Community Expert (Mobile)
      >
      > Adobe Ambassador (Pacific)
      >
      > Forum Nokia Champion
      >
      > Mobile Monday Brisbane Co-Manager
      >
      >
      >
      >
      >
      >
      >
      >
    • Show all 13 messages in this topic