POS

From C64-Wiki
Jump to: navigation, search
BASIC keyword
Keyword: POS
Abbreviation:
Type: Function
Token code: 185/$B9
Handling routine
in BASIC ROM:
45982–45989
$B39E–B3A5
List of all BASIC keywords


Remark: This article describes the BASIC-Command POS in BASIC V2 at the Commodore 64.

Typ: Integer Function 
General Programming-Syntax: POS(<"Dummy" variable>)

The function POS determined the actual position of the cursor between 0 (first char, left-sided first line) and 79 (last char, right-sided second line) of the logical screenline. The dummy argument is needed, but it does not have any effect on the result. Normally POS(0) will be used.

When the function POS is used wrong or the dummy argument is missing the BASIC error ?SYNTAX ERROR IN line will occur.

Examples[edit]

PRINT TAB(30);POS(0)


100 DIM X
110 T=TI
120 FOR I=1 TO 1000
130 X=POS(π)
140 NEXT
150 PRINT TI/60;"SECONDS"


The input of this BASIC line occurs the error ?FORMULA TOO COMPLEX ERROR:

PRINT POS("")POS("")POS("")


BASIC V2.0 (second release) Commands

ABS | AND | ASC | ATN | CHR$ | CLOSE | CLR | CMD | CONT | COS | DATA | DEF | DIM | END | EXP | FN | FOR | FRE | GET | GET# | GOSUB | GOTO | IF | INPUT | INPUT# | INT | LEFT$ | LEN | LET | LIST | LOAD | LOG | MID$ | NEW | NEXT | NOT | ON | OPEN | OR | PEEK | POKE | POS | PRINT | PRINT# | READ | REM | RESTORE | RETURN | RIGHT$ | RND | RUN | SAVE | SGN | SIN | SPC | SQR | STATUS/ST | STEP | STOP | STR$ | SYS | TAB | TAN | THEN | TIME/TI | TIME$/TI$ | TO | USR | VAL | VERIFY | WAIT