Microsoft KB Archive/57502

= LoadFont Function Example Documentation Error in Basic 7.0/7.1 =

Article ID: 57502

Article Last Modified on 11/21/2006



This article was previously published under Q57502



SUMMARY
Page 524 of the &quot;Microsoft Basic 7.0: Language Reference&quot; for Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 shows an incorrect example of how to load a font by its order in the font file. This documentation incorrectly states the following:

Note that to load fonts according to their order in the font file, l% would take the form:

l% = LoadFont%(&quot;n1,n3,n6&quot;)

The code above should read as follows (where l% means L%, not to be confused with 1%): L% = LoadFont%(&quot;n1/n3/n6&quot;) When loading multiple fonts, each font given in the fontspec$ argument of LoadFont%(fontspec$) should be separated by forward slashes (/), not by commas.

If the code in this documentation error is used, only the first font is loaded (l% contains the number &quot;1&quot;, indicating that only one font is loaded).

Code Example
The following code example demonstrates the documentation problem. To use this code example, you must start QBX.EXE with /L FONTBEFR.QLB to access the font toolbox routines. REM $INCLUDE: 'fontb.bi' '* Load the Times Roman font. SCREEN 9 PRINT &quot;Registering Times Roman font.&quot; FontNum% = RegisterFonts(&quot;D:\BC7\FONTS\TMSRB.FON&quot;) PRINT &quot;Number of fonts in the file: &quot;; FontNum% PRINT &quot;Loading fonts 4,5,6 from the Times Roman file.&quot; var1% = LoadFont%(&quot;N4,N5,N6&quot;) PRINT &quot;Number of fonts successfully loaded&quot;; var1% PRINT &quot;value of FontErr&quot;, FontErr a$ = &quot;Hello world&quot; var1% = OutGText%(100, 100, a$) END

Additional query words: BasicCom 7.00 7.10

Keywords: KB57502

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.