STR
 
Syntax

STR( expression )
Description


STR will convert a expression into a string.

For example, STR(3) will become "3", or STR(333) will become "333".

Incidentally, this is the opposite of the VAL function, which converts a string into a number.

STR is also used in certain routines of the Hardware Library to designate that a series of bytes should be read or written to a string.

Also in the following case the STR function is implied and is not required.

b$ = 333 + " sent"         '  will save the ASCI string "333 sent" into b$

The implied STR will work for simple expressions, but anything complex should use STR(), this would include any function call, array element fetches.

Example


DIM b$ (10)
a = 8421
b$ = STR(a)
PRINT a, b$     ' will display    8421     8421

Differences from other BASICs

See also