4D v16.3PLATFORM PROPERTIES |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
PLATFORM PROPERTIES
|
PLATFORM PROPERTIES ( platform {; system {; processor {; language}}} ) | ||||||||
Parameter | Type | Description | ||||||
platform | Longint |
![]() |
2 = Mac OS, 3 = Windows | |||||
system | Longint |
![]() |
Depends on the version you are running | |||||
processor | Longint |
![]() |
Processor family | |||||
language | Longint |
![]() |
Depends on the system you are using | |||||
The PLATFORM PROPERTIES command returns information about the type of operating system you are running, the version and the language of the operating system, and the processor installed on your machine.
PLATFORM PROPERTIES returns environment information in the platform, system, processor and language parameters.
platform indicates the operating system used. This parameter returns one the following predefined constants:
Constant | Type | Value |
Mac OS | Longint | 2 |
Windows | Longint | 3 |
The information returned in system depends on the version of 4D you are running.
If you are running a Mac OS version of 4D, the system parameter returns a 32-bit (Long Integer) value, for which the high level word is unused and the low level word is structured like this:
Note: In 4D, you can extract these values using the % (modulo) and \ (integer division) Numeric Operators or the Bitwise Operators.
Use the following formula to find out the Mac OS main version number:
PLATFORM PROPERTIES($vlPlatform;$vlSystem)
$vlResult:=$vlSystem\256
//If $vlResult = 16 --> you are under Mac OS 10.x
//If $vlResult # 16 --> you are under another Mac OS version
If you are running the Windows version of 4D, the system parameter returns a 32-bit (Long Integer) value, the bits and bytes of which are structured as follows:
If the high level bit is set to 0, it means you are running Windows NT, Windows 2000, Windows XP or Windows Vista. If the bit is set to 1, it means you are running a version of Windows that is too old.
Note: The high level bit fixes the sign of the long integer value. Therefore, in 4D, you just need to test the value returned by system; if it is negative, you are using an obsolete version of Windows. You can also use the Bitwise Operators.
The low byte gives the major Windows version number:
The next low byte gives the minor Windows version number.
Note: In 4D, you can extract these values using the % (modulo) and \ (integer division) Numeric Operators or the Bitwise Operators.
The processor parameter indicates the microprocessor "family" of the machine. Two values can be returned, available in the form of constants:Constant | Type | Value |
Intel compatible | Longint | 586 |
Power PC | Longint | 406 |
The combination of the platform and processor parameters can be used for example to know without ambiguity whether the machine used is of the “MacIntel” type (platform=Mac OS and processor=Intel Compatible).
The language parameter is used to find out the current language of the system on which the database is running. Here is a list of the codes that can be returned in this parameter, as well as their meanings:Language | |
1 | Arabic |
2 | Bulgarian |
3 | Catalan |
4 | Chinese |
5 | Czech |
6 | Danish |
7 | German |
8 | Greek |
9 | English |
10 | Spanish |
11 | Finnish |
12 | French |
13 | Hebrew |
14 | Hungarian |
15 | Icelandic |
16 | Italian |
17 | Japanese |
18 | Korean |
19 | Dutch |
20 | Norwegian |
21 | Polish |
22 | Portuguese |
24 | Romanian |
25 | Russian |
26 | Croatian |
26 | Serbian |
27 | Slovak |
28 | Albanian |
29 | Swedish |
30 | Thai |
31 | Turkish |
33 | Indonesian |
34 | Ukrainian |
35 | Belarusian |
36 | Slovenian |
37 | Estonian |
38 | Latvian |
39 | Lithuanian |
41 | Farsi |
42 | Vietnamese |
45 | Basque |
54 | Afrikaans |
56 | Faeroese |
Note: If the command is not able to identify the system language, the value 9 (English) is returned.
The following project method displays an alert box showing the OS software you are using:
//SHOW OS VERSION project method
PLATFORM PROPERTIES($vlPlatform;$vlSystem;$vlMachine)
If(($vlPlatform<2)|($vlPlatform>3))
$vsPlatformOS:=""
Else
If($vlPlatform=Windows)
$vsPlatformOS:=""
If($vlSystem<0)
$vsPlatformOS:="Windows version too old"
Else
$winMajVers:=$vlSystem%256
$winMinVers:=($vlSystem\256)%256
Case of
:($winMajVers=4)
$vsPlatformOS:="Windows™ NT"
:($winMajVers=5)
Case of
:($winMinVers=0)
$vsPlatformOS:="Windows™ 2000"
:($winMinVers=1)
$vsPlatformOS:="Windows™ XP"
:($winMinVers=2)
$vsPlatformOS:="Windows™ 2003"
Else
$vsPlatformOS:="Windows (undetermined version)"
End case
:($winMajVers=6)
Case of
:($winMinVers=0)
$vsPlatformOS:="Windows™ Vista"
:($winMinVers=1)
$vsPlatformOS:="Windows™ Seven"
:($winMinVers=3)
$vsPlatformOS:="Windows™ 8.1"
Else
$vsPlatformOS:="Windows (undetermined version)"
End case
:($winMajVers=10) //$vlSystem=10 also
$vsPlatformOS:="Windows™ 10"
End case
End if
$vsPlatformOS:=$vsPlatformOS+" version "+String($winMajVers)+"."+String($winMinVers)
Else
$vsPlatformOS:="OS X version "
If(($vlSystem\256)=16)
$vsPlatformOS:=$vsPlatformOS+"10"
Else
$vsPlatformOS:=$vsPlatformOS+String($vlSystem\256)
End if
$vsPlatformOS:=$vsPlatformOS+"."+String(($vlSystem\16)%16)+(("."+String($vlSystem%16))*Num(($vlSystem%16)#0))
End if
End if
ALERT($vsPlatformOS)
On Windows, you get an alert box similar to this:
On Mac OS, you get an alert box similar to this:
Product: 4D
Theme: System Environment
Number:
365
Modified: 4D v11 SQL
4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)