TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: DON SCHULLIAN
date: 1998-02-21 17:32:00
subject: Print text to SCREEN 12 i

From: d83@ath.forthnet.gr (Don Schullian)
Subject: Print text to SCREEN 12 in any color combination
 
$if 0
 
  REQUIRES PowerBASIC v3.5
 
  SUB V12print( Row%, Col%, Txt$, Fgrnd?, Bgrnd? )
    Row%   - starting row;    1 to 30
    Col%   - starting column; 1 to 80
    Txt$   - what you want printed
    Fgrnd? - foreground color; 0 to 15
    Bgrnd? - background color; 0 to 15
 
  This routine will print 8x16 characters to SCREEN 12 in any color
  combination you require regardless of the COLOR settings.
 
  Yes, it's a bit slow, even on my Pentium 200 (2400 chars in .11sec)
  but it DOES allow you to print text to your VGA screen using ANY
  color attributes, so, it's a bit of a trade off.
 
  LoadCharArray is a kludge routine to load some character data into
  the buffer. I recommend that you make a data file(s) for your font(s)
  and load directly from there into the buffer.
 
  Enjoy,
 
  ____    _    ____      ____  _____
 |  _ \  / \  / ___) __ | ___)(_   _) |  Don Schullian
 | |_)  / _ \ \____\/  \|  _)   | |   |    Gramou 33
 |____//_/ \_\(____/\__/|_|     |_|   |  Papagou, 15669
 ___________________________________  |      Greece
  =================================== |  ++30-1-654-6200
     Vertical Software Solutions      |d83@ath.forthnet.gr
 ---------------------------------------------------------
                Nutz 'n Boltz for PowerBASIC
               A library of everyday goodies!
             http://www.basicguru.com/schullian
$endif
 
DECLARE SUB V12print ( BYVAL Row%, BYVAL Col%, BYVAL Txt$, _
                       BYVAL Fgrnd?, BYVAL Bgrnd? )
 
DIM Buf(4095) AS SHARED BYTE
DIM B_ptr     AS SHARED BYTE PTR
 
B_ptr = VARPTR32( Buf?(0) )
 
' -------------------------------------------
' ---------   test code
' -------------------------------------------
DECLARE SUB LoadCharArray ()
 
SCREEN 12
LoadCharArray
DELAY 2
 
DIM Row AS INTEGER
DIM T   AS STRING
DIM T1  AS SINGLE
DIM T2  AS SINGLE
 
T$ = STRING$(2400,65)
 
CLS
T1! = TIMER
  PRINT T$;
T1! = TIMER - T1!
 
DELAY 1
CLS
T2! = TIMER
  V12print 1, 1, T$, 14, 1
T2! = TIMER - T2!
 
T$ = USING$( " ##.### ", T1! ) + _
     USING$( "##.### ", T2! )
 
FOR Row% = 1 TO 15
  V12print Row%+1, 2, T$, Row%, 0
NEXT
 
WHILE NOT INSTAT : WEND
SCREEN 0
END
 
' -------------------------------------------
' ---------   the routine
' -------------------------------------------
 
SUB V12print ( BYVAL Row   AS INTEGER, _
               BYVAL Col   AS INTEGER, _
               BYVAL Txt   AS STRING , _
 
Continued with next message...
 
*** QwkNews (tm) v2.1
 * [TN71] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.