
381
Syntax:
STR$(numericexpression)
Parameter:
numericexpression
A numeric expression.
Description:
STR$
converts the value of
numericexpression
into a string.
• If
numericexpression
is 0 or positive, then
STR$
automatically adds a lead-
ing space (m sign) as shown below.
PRINT STR$(123);LEN(STR$(123))
To delete the leading space, you should use the
MID$
function as shown below.
PRINT MID$(STR$(123),2);LEN(STR$(123))
• If
numericexpression
is negative,
STR$
adds a minus sign as shown
below.
PRINT STR$(-456);LEN(STR$(-456))
• A common use for
STR$
is to write numeric data into a data file.
• The
VAL
function has the opposite capability to
STR$
.
Reference:
STRing
String function
STR$
Converts the value of a numeric expression into a string.
Functions:
VAL
123 4
123 4
-456 4
Summary of Contents for BHT-BASIC 100 SERIES
Page 1: ......
Page 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Page 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Page 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Page 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...