SPACE returns a string of the specified length that contains only white spaces (ASCII 32):
SPACE has one – left – operand. This operand is an integer value or expression.
In a PRINT statement, the operand must be no greater that the difference
(right margin – current character position)
SPACE returns a string of white space which number is equal to its operand.
These spaces are inserted at the current character position.
SPACE operator can be used in different statements but usually it appears in the PRINT and DISPLAY statements.
In PRINT statements, SPACE moves the current character position to the right by the specified number of white spaces:
PRINT fname, 2 SPACES, lname
In DISPLAY statements, SPACE inserts the specified number of white spaces into the output:
DISPLAY "Hello,", 15 SPACES, "world!"
SPACE operator is sometimes confused with the COLUMN operator.
This example program shows how to use SPACE with a DISPLAY statement:
MAIN
DEFINE my_spaces_string char(80)
LET my_spaces_string = "-->",(5+5 SPACES),"<--"
DISPLAY "*** SPACES Example ***" AT 1,5
DISPLAY "my_spaces_string = \"-->\",(5+5 SPACES),\"<--\"" at 3,1
DISPLAY " 1234567890" at 5,1
DISPLAY my_spaces_string at 6,1
CALL fgl_getkey()
END MAIN
In this example program, SPACE is used
FORMAT
ON EVERY ROW
LET mystring = (8 SPACES), "=ZIP"
PRINT cont_fname, 2 SPACES, cont_lname
PRINT comp_name
PRINT comp_addr1
PRINT comp_city, ", " , comp_zone, 2 SPACES, comp_zip, mystring