Partager via


ALLTRIM( ) Function

Removes leading and trailing blanks from the specified character expression and returns the trimmed expression as a character string.

ALLTRIM(cExpression)

Return Values

Character

Parameters

  • cExpression
    Specifies the character expression from which leading and trailing blanks are removed.

Remarks

ALLTRIM( ) can be used to ensure that blanks are removed from data entered by a user.

Example

The following example uses AFONT( ) to create an array containing the names of all available fonts. ALLTRIM( ) is used to remove leading and trailing spaces from the font names. The trimmed name of each font is displayed along with an example of the font. If more than 10 fonts are installed, only the first 10 are displayed.

CLEAR
=AFONT(gaFontArray)  && Array containing font names
gnNumFonts= ALEN(gaFontArray)  && Number of fonts
IF gnNumFonts > 10
   gnNumFonts = 10  && Display first 10 fonts
ENDIF

FOR nCount = 1 TO gnNumFonts
   ? ALLTRIM(gaFontArray(nCount))  && Display font name
   ?? '  This is an example of ' ;
      + ALLTRIM(gaFontArray(nCount)) FONT gaFontArray(nCount), 8
ENDFOR

See Also

LTRIM( ) | RTRIM( ) | TRIM( ) | AFONT( )