ALLTRIM( ) Function 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