String function SPC

20  SPC (n)
Returns a string of n spaces.

See examples

If there is insufficient information on this page and you wish learn more about SPC, please send an email to smallbasic@gmail.com. You can help to improve information about SPC by submitting an article using the comments link below. Note, an offline language reference text file is now avialable – see the Download section.


These are excellent for maintaining a fixed length string or buffer or record or refining screen output by inserting a specified amount of spaces in a string. This works well with LEFT and RIGHT keywords for Left Center or Right aligning text.

'here are right aligned numbers in 10 character length string between two single quote marks
while 1
  ? "'";RIGHT(SPC(10)+STR(myNumber),10);"'";SPC(3)+"press a key or click for next..."

I think SPACE and SPC are both the same, see also SPACE.