RosettaCodeData/Task/Host-introspection/M2000-Interpreter/host-introspection.m2000
2023-07-01 13:44:08 -04:00

29 lines
914 B
Text

Module CheckIt {
\\ Always run in Little-endian, 32 bits (in Wow64 in 64 bit os)
Module EndiannessAndSize {
Buffer Check as Long
Return Check, 0:=1
if eval(Check, 0 as byte)=1 then {
Print "Little-endian"
}
\\ 4 bytes
Print "Word size:"; Len(Check)*8;" bits"
}
EndiannessAndSize
\\ Access to internal com object clsOsInfo
Declare OsInfo Information
Print Type$(OsInfo) ="clsOSInfo"
\\ Build is a read only property
With OsInfo, "Build" as Build, "OSName" as OSName$, "IsElevated" as IsElevated
Print OsName$
Print "Build=";Build
\\ IsWow64 is a function
Method OsInfo, "IsWow64" as IsWow64
If IsWow64 Then {
Print "64 bit Os"
} Else {
Print "32 bit OS"
}
Print "IsElevated:";IsElevated
}
Checkit