EasyManua.ls Logo

Commodore PET - BASIC Format Functions; Pos; Spc

Commodore PET
447 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
arg
VAL converts the string argument by first discarding any leading blanks. If
the first non-blank character
is
not a numeric
digit
(0-9), the argument
is
returned
as
a value of
O.
If
the first non-blank
is
a digit. VAL begins converting the string
into real number format.
If
it subsequently encounters a non-digit character.
it
stops processing so
that
the argument returned
is
the numerical equivalent of the
string up to the first non-digit character.
Examples:
A=VAL("123")
NN=VAL(B$)
BASIC FORMAT FUNCTIONS
POS
POS
is
a limited use function that returns the column position of the cursor.
Format:
POS(arg)
where:
is
a
dummy
argument and may
be
string or
numeric.
For
POS
purposes, the character positions along each row are numbered 0
through 39. Character positions for a string
are
numbered 0 through 255.
POS
returns the current cursor position (0-255) except after a Home, Clear Screen, or
POKE,
which
do not reset the
POS
indicator. The position
is
taken
as
the current
cursor position before the
POS
function itself
is
typed.
POS
is
reset to 0 at each
RETURN.
Examples:
?POS(1)
?"0iliJ
ABC";POS(1)
SPC
At
the beginning of a line,
returns
O.
With
a previous
POS
value of
0,
prints a
POS
value of
6.
SPC
moves the cursor right a specified number of positions.
159

Table of Contents

Related product manuals