In a data entry application that uses a rich visual interface, you may want to exert programmatic control over the orientation of the screen, e.g., whether the display is horizontal or vertical. For computers with video cards that support changing the display orientation, which includes most new computers as well as tablet PCs, two functions can be used to control the orientation. Calls to these functions are ignored when executed on mobile devices.
b = getorientation();
The getorientation function returns the current display orientation. The function will return one of four values:
0: The natural orientation of the display device
90: The display orientation is rotated 90 degrees from the natural orientation
180: The display orientation is rotated 180 degrees from the natural orientation
270: The display orientation is rotated 270 degrees from the natural orientation
b = setorientation(numeric-expression);
The setorientation function changes the orientation of the display. The numeric expression must be one of the four values listed above. The function returns 1 if the display orientation was successfully changed, 0 otherwise.
numeric nextOrientation = getorientation() + 90;
if nextOrientation = 360 then
nextOrientation = 0;