DisplayWidth

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

This is a special variable. It holds the width of the display screen (in pixels), which is obtained from the computer system. The value is available to be used in expressions and calculations involving the size and location of a program's windows.

Usage

WindowWidth = DisplayWidth

Hints

Centering a Program Window. To center a window on the display width, use this expression:
UpperLeftX = int((DisplayWidth-WindowWidth)/2)

Example

    print "Screen width is ";DisplayWidth
    print "Screen height is ";DisplayHeight

Useful Procedures

' Place a useful function or sub using this keyword here