SPACE$

Contents


space$(n) returns a string of n spaces.

 

Syntax

   space$( nb_esp )

 

Parameters

Element

Description

Restrictions

nb_esp

Integer expression of the number of spaces.

nb_esp >= 0

 

Examples

   # Display '*' followed by 5 spaces and '*'
    Infbox '*'+space$(5)+'*'
   # Display a left, then right-justified string, over precisely
   # 35 characters. These examples only work if len(CHAINE) <= 35
    Infbox CHAINE+space$(35 - len(CHAINE))
    Infbox space$(35 - len(CHAINE))+CHAINE

 

Description and comments

space$(nb_esp) returns a string comprising nb_esp spaces (ascii code 32). This function is thus equivalent to string$(nb_esp, 32).

The result is a Char type.

 

Comment

If nb_esp is greater than 255, the string returned by space$ is space$(255) without generating an error (truncation to 255 is performed automatically). space$(0) returns "" (empty string).

 

Associated errors

Error

Description

ERDOM (50)

The argument nb_esp is strictly negative.

 

Associated key words

STRING$ - ASCII - CHR$ - VIREBLC


CONTENTS


Copyright © Sage 1999 - 2007