Not getting what I'd expect. Please check my code.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

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

Not getting what I'd expect. Please check my code.

Post by shawnblc » Fri May 23, 2014 7:33 am

I'm basically try to determine if the system is OSX or Windows. Not getting what I'd expect with the following.
Pointers anyone?

Code: Select all

    if fld "fldSystemVersion" contains "10" then put "OSX" into fld "fldOSTitle" else
    put "Windows" into fld "fldOSTitle"
Last edited by shawnblc on Fri May 23, 2014 7:43 am, edited 1 time in total.

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: Not getting what I'd expect. Please check my code.

Post by sefrojones » Fri May 23, 2014 7:43 am

shawnblc wrote:I'm basically try to determine if the system is OSX or Windows. Not getting what I'd expect with the following.
Pointers anyone?

Code: Select all

    if fld "fldSystemVersion" contains "10" then put "OSX" into fld "fldOSTitle" else
    put "WIndows" into fld "fldOSTitle"
What about something like this:

Code: Select all

    if the platform is "macOS" then put "OSX" into fld "fldOSTitle" else
    put "WIndows" into fld "fldOSTitle"

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

Re: Not getting what I'd expect. Please check my code.

Post by shawnblc » Fri May 23, 2014 7:46 am

What about something like this:

Code: Select all

    if the platform is "macOS" then put "OSX" into fld "fldOSTitle" else
    put "WIndows" into fld "fldOSTitle"
Doesn't work either, but I appreciate the assistance. Anyone else?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Not getting what I'd expect. Please check my code.

Post by Simon » Fri May 23, 2014 7:48 am

What does
put systemversion()
in the message box return?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: Not getting what I'd expect. Please check my code.

Post by sefrojones » Fri May 23, 2014 7:58 am

This code seems to be working:

Code: Select all

if fld "fldsystemversion" contains "10" then 
      put "osx" into fld "fldOStitle"
   else
      put "windows" into fld "fldOStitle"
   end if
at least on the windows side. I have tried with things like 10.10.0, and 10.1.5, etc int the fld "systemversion" and it seems to be working. I am testing on a windows system though.....
Last edited by sefrojones on Fri May 23, 2014 7:59 am, edited 1 time in total.

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

Re: Not getting what I'd expect. Please check my code.

Post by shawnblc » Fri May 23, 2014 7:59 am

Simon wrote:What does
put systemversion()
in the message box return?

Simon
Awesome Simon!

Thank you. Just tested on both OSX and Windows. Got what I was expecting. Thank you sir.

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Not getting what I'd expect. Please check my code.

Post by Klaus » Fri May 23, 2014 11:21 am

Hi Shawn,

yep "systemversion'()" is it :D

But please allow a short question:
In your examples HOW and WHERE did your field "fldsystemversion" get filledt? 8)


Best

Klaus

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

Re: Not getting what I'd expect. Please check my code.

Post by shawnblc » Fri May 23, 2014 2:17 pm

Klaus wrote:Hi Shawn,

yep "systemversion'()" is it :D

But please allow a short question:
In your examples HOW and WHERE did your field "fldsystemversion" get filledt? 8)


Best

Klaus
I have the following to fill the fld "fldSystemVersion"

Code: Select all

put the systemVersion into fld "fldSystemVersion"

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Not getting what I'd expect. Please check my code.

Post by Klaus » Fri May 23, 2014 2:27 pm

Thanks!

And what exactly is the difference from using "the systemversion" directly? 8)

Post Reply