From QB64 Wiki
Revision as of 10:33, 12 July 2010 by imported>Clippy
Jump to navigation Jump to search

The SPACE$ function returns a STRING consisting of a number of space characters.


result$ = SPACE$( count% )


  • count% is the number of space characters to repeat.
  • If count% is negative, an illegal function call error is thrown.
  • Can be used in any string value using the + concatenation operator.
  • Semicolons or + can be used in a screen PRINT or PRINT (file statement).
  • Spaces are often used to erase previous text PRINTs from the screen.
  • Spaces can also be made using SPC, CHR$(32) or STRING$(n%, 32).


FOR count% = 0 TO 3 PRINT "abc" + SPACE$( count% ) + "def" NEXT count%

abcdef abc def abc def abc def

See also

Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page