STRING$ |
String$ is used to define a string, the result of repeating a sub-string or an ascii code
string$(nb_char, sub_string)
string$(nb_char, code_char)
|
Element |
Description |
Restrictions |
|
nb_char |
Integer numerical expression of the repeat factor of the characters or sub_string |
nb_char >= 0 |
|
sub_string |
Alphanumeric expression that will be repeated |
None |
|
code_char |
Integer numerical expression corresponding to the ascii code of the character to be repeated. |
0 <= code_char <=255 |
# 5 'A' characters may be displayed by one of the 2 lines:
Infbox string$(5, 'A')
Infbox string$(5, 65)
string$(nb_char, code_char) returns a string comprising nb_char characters with ascii code code_char.
string$(nb_char, sub_string) returns a string comprising the repeat of the sub_string nb_char times.
The result is a Char type.
If the number of characters in the result is more than 255, the string returned is truncated to 255 characters without generating an error.
If nb_char is null or if code_char is null or if sub_string is the empty string, the result returned by string$ is the empty string.
|
Error |
Description |
|
ERDOM (50) |
- code_chr is negative or more than
255. |
|
ERMODE (10) |
nb_char is not numerical. |
SPACE$ - ASCII - CHR$ - GRAPH$
|
|