home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / basic / bmag / fc.bas < prev    next >
Encoding:
BASIC Source File  |  1994-04-26  |  1.6 KB  |  39 lines

  1. '─ Area: F-QUICKBASIC ─────────────────────────────────────────────────────────
  2. '  Msg#: 375                                          Date: 18 Apr 94  15:20:00
  3. '  From: Saul Ansbacher                               Read: Yes    Replied: No 
  4. '    To: Howard Hull Jr                               Mark:                     
  5. '  Subj: Fast Character Printing
  6. '──────────────────────────────────────────────────────────────────────────────
  7. 'HHJ>        I need a quick way to put characters on the current page in
  8. 'HHJ>screen mode 0.  I've looked into a few memory swapping utils but they
  9. 'HHJ>didn't do what I needed them to do.
  10.  
  11. 'HHJ>        I know that the address of the color screen if &HB000 or
  12. 'HHJ>something like that.  And that the individual screen positions are
  13. 'HHJ>accessable at certain offsets. So by poking information at those offsets
  14. 'HHJ>I can change the characters and attributes, but I just can't figure out
  15. 'HHJ>a quick meathod to do this.
  16.  
  17. DECLARE SUB PrintRC (Strg$, Row, Col, Fg, Bg)
  18.  
  19. CLS
  20. PrintRC "Hello silly people", 12, 1, 13, 1
  21. END
  22.  
  23. SUB PrintRC (Strg$, Row, Col, Fg, Bg)
  24.     Attr = Fg + Bg * 16
  25.     DEF SEG = &HB800   ' B000 for monochrome systems
  26.     Offset = (Row - 1) * 160 + (Col - 1) * 2
  27.     FOR i = 1 TO LEN(Strg$)
  28.         POKE Offset, ASC(MID$(Strg$, i, 1)): Offset = Offset + 1
  29.         POKE Offset, Attr: Offset = Offset + 1
  30.     NEXT
  31.     DEF SEG
  32. END SUB
  33.  
  34. 'The Strg$ can be any thing even non printable chars like chr(12) and
  35. 'things, it's really nice code. The day I needed to make just such a
  36. 'thing I came home and it was in my QWK packet, thanks to Matt Hart for
  37. 'posting it...
  38.  
  39.