Skip to main content

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.

Example

DIM b$ (10)

a = 8421

b$ = STR(a)

PRINT a,
b$ ' will display
8421 8421

Differences from other BASICs

  • same function in Visual BASIC
  • similar to DEC formatting function in PBASIC

See also