SysInfo: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "SYSINFO(''number'') '''Description''' SYSINFO returns information about the device. This is not a complete list of return values: see Microsoft’s documentation on GetSyste...")
 
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
SYSINFO(''number'')
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''  


'''Description'''
SysInfo(''number'')


SYSINFO returns information about the device. This is not a complete list of return values: see Microsoft’s documentation on GetSystemMetrics and GetDeviceCaps for more.
== Description ==
 
SysInfo returns information about the device.  
 
Screen sizes may be reported differently depending on the device and operating system. If you want to get a headache, read this analysis of screen size issues on mobile devices:
 
http://tripleodeon.com/2011/12/first-understand-your-screen/
 
Also, see this handy table:
 
http://tripleodeon.com/assets/2011/12/table.html


{| class="wikitable"
{| class="wikitable"
|-
|-
| SM_CXSCREEN || 0 || Width of screen
| 0 || Width of screen - actual screen size in Portrait mode || SM_CXScreen
|-
| 1 || Height of screen - actual screen size in Portrait mode || SM_CYScreen
|-
|-
| SM_CYSCREEN || 1 || Height of screen
| 2 || Width of screen in current orientation ||  
|-
|-
| || 10 || Milliseconds since 01/01/70
| 3 || Height of screen in current orientation ||  
|-
|-
| HORZREZ || 108 || HiRes Display width pixels
| 4 || Running on a touch screen device? True/False ||  
|-
|-
| VERTREZ || 109 || HiRes Display height pixels
| 5 || Device Pixel Ratio: how many physical pixels make up 1 display pixel? For example, on a retina device, this value will be 2. Same as window.devicePixelRatio||  
|-
|-
| LOGPIXELSX || 188 || Pixels per inch horizontal
| 10 || Milliseconds since 01/01/70 ||
|-
|-
| LOGPIXELSY || 190 || Pixels per inch vertical
| 108 || screen.availWidth ||
|-
| 109 || screen.availHeight ||
|}
|}


'''Example'''
== Example ==


<pre>
<pre>
REM SYSINFO Example
Rem SysInfo Example
MSGBOX "The device’s DPI is " & sysInfo(188)
MsgBox "The device’s device pixel ratio is " & SysInfo(5)
</pre>
</pre>


'''Output'''
== Output ==


Running on iPhone 5 with retina display:
<pre>
<pre>
The device’s DPI is 96.
The device’s device pixel ratio is 2
</pre>
</pre>
[[Category:Language Reference]]
[[Category:Miscellaneous]]
[[Category:BASIC Functions]]

Latest revision as of 15:36, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

SysInfo(number)

Description

SysInfo returns information about the device.

Screen sizes may be reported differently depending on the device and operating system. If you want to get a headache, read this analysis of screen size issues on mobile devices:

http://tripleodeon.com/2011/12/first-understand-your-screen/

Also, see this handy table:

http://tripleodeon.com/assets/2011/12/table.html

0 Width of screen - actual screen size in Portrait mode SM_CXScreen
1 Height of screen - actual screen size in Portrait mode SM_CYScreen
2 Width of screen in current orientation
3 Height of screen in current orientation
4 Running on a touch screen device? True/False
5 Device Pixel Ratio: how many physical pixels make up 1 display pixel? For example, on a retina device, this value will be 2. Same as window.devicePixelRatio
10 Milliseconds since 01/01/70
108 screen.availWidth
109 screen.availHeight

Example

Rem SysInfo Example
MsgBox "The device’s device pixel ratio is " & SysInfo(5)

Output

Running on iPhone 5 with retina display:

The device’s device pixel ratio is 2