[RPG/JS] Screen dimensions

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
mwilliams
Posts: 20
Joined: Fri May 19, 2017 1:34 am

[RPG/JS] Screen dimensions

Post by mwilliams »

Is it possible to get the device screen dimensions from within a script? Maybe using the q_getSystemValue function?
tsupartono
Posts: 289
Joined: Wed Apr 18, 2012 10:21 am

Re: [RPG/JS] Screen dimensions

Post by tsupartono »

Below is an example of getting the screen width & height (in the current device orientation), and outputs the result to the console.

Code: Select all

lrexec(
    function()
    {
        this.q_getSystemValue("DEVICE-SCREEN-SIZE-WIDTH");
    },    
    function(value)
    {
        this.console("screen-width = " + value);
        this.q_getSystemValue("DEVICE-SCREEN-SIZE-HEIGHT");
    },
    function(value)
    {
        this.console("screen-height = " + value);
    },
}
Post Reply