GLBasic User Manual

Main sections


info$ = PLATFORMINFO$(what$)

Returns a string with platform specific information. The parameter what$ decides which value to return in info$.

what$ = "" (empty)

: the platform will be reported:
"LINUX" = Linux operating system
"WIN32" = Windows Desktop (9x, NT, XP, 2003, ...)
"WINCE" = PocketPC
"GP2X" = GP2X
"IPHONE"= iPhone / iPad / iPod Touch

what$ = "DOCUMENTS"

returns the directory for user documents. You should be able to write files in that directory if necessary.

what$ = "APPDATA"

offers a directory to put application specific settings. It's wise to create a subdirectory with the program name, here.

what$ = "ID"

returns a unique computer id consisting of figures 0-9 and letters 'A'-'F' only.

what$ = "DEVICE"

returns what hardware the program is running on. Possible return values are:
"DESKTOP" - Any PC with keyboard and mouse

"POCKETPC" - WinCE, touchscreen
"SMARTPHONE" - WinCE, no touchscreen, number block
"WINCE" - WinCE, no further information

"F100" - a GP2X-F100 device
"F200" - a GP2X-F200 device (with touchscreen)
"WIZ" - a GPH GP2X-Wiz device
"CAANOO" - a GHP Caanoo device

"IPHONE" - iPhone
"IPOD TOUCH" - iPod Touch
"IPAD" - iPad

"KEYBOARD" - (Android) with keyboard
"TOUCHSCREEN" - (Android) without keyboard

"PIXI" - Palm Pixi, HP Veer
"PRE" - Palm Pre, HP Pre2, Pre3
"TOUCHPAD" - HP Touchpad

what$ = "BATTERY"

returns the battery lifetime in percent.

what$ = "TIME"

returns the current date and time. You can use SPLITSTR to get parts of that.

what$ = "UTCTIME"

returns the current date and time as a universal coordinated date and time. You can use SPLITSTR to get parts of that.

what$ = "GLEXT:xxxx"

returns 1 or 0, depending on whether the OpenGL extension 'xxxx' was found (wglGetProcAddress). e.g. "GLEXT:glBindFramebufferEXT" is required for a fast USESCREEN.

what$ = "COMPILED"

returns the date when the program was built: "Oct 2008 5-16:35:27"

what$ = "VERSION"

returns the version string you entered in the project options.

what$ = "HOSTID"

returns the computer serial number from the machine this program was compiled on. The number is shown in the precompiler as "SN:xxxxxxxx".

what$ = "LOCALE"

returns the language of the operating system in http country code syntax, lower-case.
The most important might be:
us, uk, es, fr, de, au

what$ = "TEMP"

returns the full path to the operating system's temporary directory. In the case of Vista/Windows 7, this could be something like C:\Users\Nicholas\AppData\Local\Temp

was$ = "DPI"

returns the DPI (dots per inch) of the display. The return value is just an aproximate size.
PC: 96 (some have 120+)
iPhone 3: 163
iPhone, retina: 326
iPad: 132
iPad retina: 264
iPad mini: 163

info$ = PLATFORMINFO$("") // What device is this
PRINT "Platform = " + info$, 0, 20

info$ = PLATFORMINFO$("ID") // Get unique device id
PRINT "ID = " + info$, 0,40

// 2006-7-28 18:59:45
info$ = PLATFORMINFO$("TIME") // Get date + time
PRINT "Time = " + info$, 0, 80


See also...