
7-6
Section
Details of BASIC Commands
222
str$
Syntax:
STR
$ (<numerical expression>)
Description:
Function. Converts a numerical expression into a character string representation.
Remarks:
<numerical expression> may be any integer, single-precision floating point or double-precision
floating point expression.
If the expression is positive a space is prefixed to the character string representation. If the
numerical expression is negative a minus sign (-) is prefixed to the character string representation.
The
VAL
function is the opposite of the
STR
function; it converts a character string into its
equivalent numerical expression.
Examples:
> 10 FOR A = 1 TO 5
> 20 A$ = STR$(A)
> 30 PRINT A$
> 40 NEXT A
> RUN
1
2
3
4
5
See also:
VAL
string$
Syntax:
STRING
$ ( <numerical expression 1>, ( <numerical expression 2> | <string expression>) )
Description:
Function. Outputs a specified number of a certain character.
Remarks:
<numerical expression 1> is the number of the specified character that should be in the output
string. It may be any integer, single-precision floating point or double-precision floating point
expression. Non-integer expressions will be rounded. Valid range: [0…255]. If this value is zero
an empty string will be returned.
The second argument of STRING$ gives the character that should be repeated the specified
number of times in the output string. This can be specified as a character code or as a character
string. If specified as a character code the valid range is: [0…255]. If specified as a character
string the first character in the string will be assumed to be the desired character.
Use the
STRING
$ function when you need to make a character string with a series of the same
character.
Examples:
> 10 FOR A = 1 TO 5
> 20 A$ = STRING$(A, "*")
> 30 PRINT A$
> 40 NEXT A
> RUN
*
**
***
****
*****
See also:
SPACE
$
Содержание C200H-ASC11
Страница 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Страница 2: ...iv...
Страница 4: ...vi...