Q68588: OutGText% Works Only on First Call If WINDOW Invoked; UI Font
Article: Q68588
Product(s): See article
Version(s): 7.00 7.10
Operating System(s): MS-DOS
Keyword(s): ENDUSER | SR# S910114-77 | mspl13_basic
Last Modified: 29-JAN-1991
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.
This information applies to the User Interface (UI) Toolbox Font
procedures in Microsoft BASIC Professional Development System (PDS)
versions 7.00 and 7.10 for MS-DOS. (See GTextWindow in the README.DOC
file.)
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
"Hello world" in the location (0,100). If GTextWindow is not called,
"Hello world" will be displayed twice in two different locations.
SCREEN 9
FontNum% = RegisterFonts("TMSRB.FON")
var1% = LoadFont%("N4,N5,N6")
a$ = "Hello world"
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
Reference
---------
According to the README.DOC file for BASIC PDS 7.00 and 7.10, after
the first call to OutGText to output text, you must precede each
subsequent call to OutGText with a call to GTextWindow in order to
preserve logical coordinates of the window.
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.