A more up to date OSVersion.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

A more up to date OSVersion.

Post by DoubleDutch »

It would be nice if OSVersion() was updated (the docs only list up to mac osx 10.11), possibly with a new command OSVersionString().
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
MacDefender
New User
New User
Posts: 5
Joined: Tue Jun 11, 2019 5:50 pm
Location: Germany

Re: A more up to date OSVersion.

Post by MacDefender »

I would like to see this updates too. I noticed that in 5.71 beta 1 there also #PB_OS_MacOSX_10_12 available but nothing for 10.13-10.15

If I look at the return paramater of OSVersion unter macOS the value returned is just 11200 so it should be possible to already include values for 10.16 and 10.17 in advance. Or maybe just add functions like OSVersionMajor() and OSversionMinor() that passes the OS version as an integer?
I know that it is possible to use processInfo operatingSystemVersion (really quick and dirty) but it would be nice to have a native functions for this:

Code: Select all

NSProcessInfo = CocoaMessage( 0, 0, "NSProcessInfo processInfo" )
If NSProcessInfo
  NSVersion = CocoaMessage( 0, NSProcessInfo, "operatingSystemVersion" )
  vMajor = PeekI( NSVersion )
  vMinor = PeekI( NSVersion + 8 )
  vPatch = PeekI( NSVersion + 16 )
  Debug( "Version: " + Str( vMajor ) + "." + Str( vMinor ) + "."+ Str( vPatch ) )
EndIf
Post Reply