Difference between revisions of "MC-Basic:STRING$"

From SoftMC-Wiki
Jump to: navigation, search
m (Text replace - "''<number>''" to "<''number''>")
m (Text replace - "''<return value>''" to "<''return value''>")
Line 15: Line 15:
  
 
|TYPE=
 
|TYPE=
''<return value>'': String<br>
+
<''return value''>: String<br>
 
<''number''>: Long<br>
 
<''number''>: Long<br>
 
''<string>'': String<br>
 
''<string>'': String<br>
Line 21: Line 21:
  
 
|RANGE=
 
|RANGE=
''<return value>'': String<br>
+
<''return value''>: String<br>
 
<''number''>: 0 to MaxLong<br>
 
<''number''>: 0 to MaxLong<br>
 
''<string>'': String<br>
 
''<string>'': String<br>

Revision as of 09:37, 20 March 2014

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