SPACE

Top  Previous  Next

Action

Returns a string of spaces.

 

 

Syntax

var = SPACE(x )

 

 

Remarks

X

The number of spaces.

Var

The string that is assigned.

Using 0 for x, will result in a string of 255 bytes because there is no check for a zero length assign.

 

 

See also

STRING, SPC

 

 

Example

Dim s as XRAM String * 15, z as XRAM String * 15

s = Space(5)

Print " {"  ;s ; " }"                                 '{     }

 

Dim A as Byte

A = 3

S = Space(a)

 

Genereated code for last 2 lines :

; ---------- library routine -----------

_sStr_String:

Mov @r1,a

Inc r1

Djnz r2,_sStr_String

Clr a

Mov @r1,a

Ret

;---------------------------------------

Mov R1,#h'22 ; location of string

Mov R2,h'21  ; number of spaces

Mov a,#32

Acall _sStr_String