QBasic 1.1: PMAP Function
Explanation
PMAP Function
Returns the window coordinate equivalent to a viewport coordinate, as defined by the WINDOW statement, or vice versa.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
PMAP (startcoordinate#, n%) |
Description / Parameter(s)
startcoordinate# |
A window or viewport coordinate. |
n% |
A value indicating which coordinate is returned: |
|
startcoordinate# | n% | Returns |
Window x coordinate | 0 | Viewport x coordinate |
Window y coordinate | 1 | Viewport y coordinate |
Viewport x coordinate | 2 | Window x coordinate |
Viewport y coordinate | 3 | Window y coordinate |
|
Example
'This example requires a graphics adapter that supports screen mode 1.
SCREEN 1
WINDOW SCREEN (0, 0)-(100, 100)
PRINT "Logical x=50, physical x="; PMAP(50, 0)
PRINT "Logical y=50, physical y="; PMAP(50, 1)