MC-Basic:STRING$

From SoftMC-Wiki
Jump to: navigation, search
Language: English  • 中文(简体)‎

STRING$ produces a new string with the specified number of characters. Each character is the first character of the specified string argument or the specified ASCII code.

Syntax

STRING$(<number>,<string>)

STRING$(<number>,<ascii code>)

Availability

All versions

Type

<return value>: String
<number>: Long
<string>: String
<ascii code>: Long

Range

<return value>: String
<number>: 0 to MaxLong
<string>: String
<ascii code>: 0 to MaxLong

NOTE-Info.svgNOTE
The ASCII code set comprises 256 codes (0 to 255). If the specified <ascii code> is less than 255, <ascii code> is evaluated modulo 256 and the remainder is used as the ASCII code.

Scope

Configuration, Task or Terminal

Limitations

Read only. Input string cannot be a UTF-8 string.

Examples

? STRING$(23, “*”) generates a string of 23 asterisks

? STRING$(23, “*5”) generates a string of 23 asterisks

? STRING$(9, 65) generates a string of 9 A’s à AAAAAAAAA

See Also