Microsoft KB Archive/68588

= OutGText% Works Only on First Call If WINDOW Invoked; UI Font =

Article ID: 68588

Article Last Modified on 11/21/2006



This article was previously published under Q68588



SUMMARY
Using the OutGText% function more than once does not display the text in the same location if you have invoked the SCREEN command prior to invoking OutGText%. GTextWindow must be called before any OutGText% commands. The GTextWindow subroutine is in the FONTB.BAS file, and also in the UITBEFR.QLB Quick library.

This information applies to the User Interface (UI) Toolbox font procedures in Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS. (See GTextWindow in the README.DOC file.)



MORE INFORMATION
The procedure OutGText% initializes the screen to its full-screen parameters before displaying the user's text. To reinitialize the screen back to its original user-specified parameters, GTextWindow must have been called. GTextWindow stores the screen coordinates for later use (for example, in the OutGText% function).

Because the WINDOW statement uses the same parameters as GTextWindow, you may want to include the command WINDOW(X1,Y1,X2,Y2) in the GTextWindow procedure, and substitute the GTextWindow call whenever referencing the WINDOW statement.

Code Example
The code below demonstrates the correct method to display the text &quot;Hello world&quot; in the location (0,100). If GTextWindow is not called, &quot;Hello world&quot; will be displayed twice in two different locations. SCREEN 9 FontNum% = RegisterFonts(&quot;TMSRB.FON&quot;) var1% = LoadFont%(&quot;N4,N5,N6&quot;) a$ = &quot;Hello world&quot; CALL GTextWindow(-200, -200, 200, 200, FALSE)  'store coordinates WINDOW (-200, -200)-(200, 200) PSET (0, 100) var1% = OutGText%(0, 100, a$) var1% = OutGText%(0, 100, a$) PSET (0, 100) END According to the README.DOC file for Basic PDS 7.0 and 7.1, after the first call to OutGText to output text, you must precede each subsequent call to OutGText with a call to GTextWindow to preserve logical coordinates of the window.

Additional query words: BasicCom 7.00 7.10

Keywords: KB68588

-

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

© Microsoft Corporation. All rights reserved.