QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The STRING$ function returns a STRING consisting of a single character repeated a number of times.

Syntax

result$ = STRING$(count&, {character$ ASCIIcode%} )

Description

Differences between QB64 and QB 4.5:

Example(s)

Printing 40 asterisks across the screen using an ASCII character code instead of CHR$(42).


PRINT STRING$(40, 42)


****************************************

Using a STRING to specify the repeated character.


text$ = "B" + STRING$(40, "A") + "D"
PRINT text$


BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD

See Example(s)

See Also