Revolution vs Visual Basic

Ken Ray kray at sonsothunder.com
Wed Mar 8 13:46:41 EST 2006


On 3/8/06 12:28 PM, "Garrett Hylltun" <garrett at paraboliclogic.com> wrote:

> put fontNames() into varTempPreProcess
> put the number of lines of varTempPreProcess into varTemp
> put 1 into varCounter
> repeat varTemp times
>    put line varCounter of varTempPreProcess into varTempFont
>    if the fontLanguage of varTempFont is "ANSI" then
>      put varTempFont & return after varFontMenuBuild
>    end if
>    put varCounter + 1 into varCounter
> end repeat
> sort lines of varFontMenuBuild

This could be shortened thusly:

  put "" into varFontMenuBuild
  repeat for each line varTempFont in fontNames()
    if the fontLanguage of varTempFont = "ANSI" then put varTempFont & \
      CR after varFontMenuBuild
  end repeat
  delete char -1 of varFontMenuBuild  -- remove trailing CR
  sort lines of varFontMenuBuild

Just curious... any particular reason you need just the ANSI font names if
the list of fonts returned by fontNames() is what's installed in the
computer?

If not, then it's even easier:

  put fontNames() into varFontMenuBuild
  sort lines of varFontMenuBuild
 

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the Use-livecode mailing list