The latest Windows 10 version isn't matching anymore with the available #PB_OS_Windows_10 constant, so we need a new one ("...10_1"?) for using related CompilerIf statements etc.
Thank you!
#PB_Compiler_OS constant for latest Windows 10 update
-
- Addict
- Posts: 4519
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: #PB_Compiler_OS constant for latest Windows 10 update
[deleted]
Last edited by Little John on Sat Jul 21, 2018 8:55 pm, edited 1 time in total.
Re: #PB_Compiler_OS constant for latest Windows 10 update
I think it would be useful to know what ver from the command prompt it's saying.Andre wrote:The latest Windows 10 version ...
Code: Select all
Microsoft Windows [Version x.y.z.w]
Does it return "#PB_OS_Windows_Future" ?
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
-
- Addict
- Posts: 4519
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: #PB_Compiler_OS constant for latest Windows 10 update
ver wrote:Microsoft Windows [Version 10.0.17134.165]
Code: Select all
; PB 5.70 beta 1 (x64)
Debug #PB_Compiler_OS ; -> 1
Debug #PB_OS_Windows ; -> 1
Debug #PB_OS_Windows_10 ; -> 110
Debug OSVersion() ; -> 110
I compared #PB_Compiler_OS with #PB_OS_Windows_10, and both are not equal.
But now I think that #PB_OS_Windows_10 is only meant for comparison with the result of OSVersion(). These values are equal here.
- Andre
- PureBasic Team
- Posts: 2056
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: #PB_Compiler_OS constant for latest Windows 10 update
I can confirm the same Debug output like LittleJohn showed.
I stumpled across this "problem" using #PB_Compiler_OS, which gives 1 here and this way
couldn't be used anymore to react on Windows version = 10 or newer (as all previous versions return smaller values).
My fault?
Or is here really something missing in relation with #PB_Compiler_OS?
I stumpled across this "problem" using #PB_Compiler_OS, which gives 1 here and this way
Code: Select all
CompilerIf #PB_Compiler_OS >= #PB_OS_Windows_10
My fault?
Or is here really something missing in relation with #PB_Compiler_OS?
Re: #PB_Compiler_OS constant for latest Windows 10 update
@Andre
#PB_Compiler_OS like the name suggests is the target OS for the compiler you are using. For example "Windows", not Windows 7, 8, 10, ecc.
OsVersion() checks at runtime the version of the OS, so its return value can be compared to #PB_OS_*
#PB_Compiler_OS possible values are also documented as follows and so it should be compared just against these values:
#PB_Compiler_OS like the name suggests is the target OS for the compiler you are using. For example "Windows", not Windows 7, 8, 10, ecc.
OsVersion() checks at runtime the version of the OS, so its return value can be compared to #PB_OS_*
#PB_Compiler_OS possible values are also documented as follows and so it should be compared just against these values:
#PB_Compiler_OS : Determines on which OS the compiler is currently running. It can be one of the following values:
#PB_OS_Windows : The compiler is running on Windows
#PB_OS_Linux : The compiler is running on Linux
#PB_OS_MacOS : The compiler is running on Mac OS X
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
- Andre
- PureBasic Team
- Posts: 2056
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: #PB_Compiler_OS constant for latest Windows 10 update
@luis: You're right, thank you for the clarification
According to the manual the CompilerIf statements can only check the system (Win, Linux, MacOS), but not a specific version (that's what I assumed, my mistake).
So I'll move this topic to Coding questions now...
According to the manual the CompilerIf statements can only check the system (Win, Linux, MacOS), but not a specific version (that's what I assumed, my mistake).
So I'll move this topic to Coding questions now...