| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | SUB needed |
MB> I have been trying to get GET to grab a 25x80 screen and save it
MB> into an array, and later on in the program to use PUT to recall the
MB> screen. I keep getting illegal function calls and I can't seem to
MB> figure it out. I have read and re-read the section on GET and PUT in
MB> the QuickBasic Bible and it seems not help. The screen that I want
MB> to grab is an ANSI screen. The bottom 2 lines are a status line that
MB> doesn't need to be grabbed as this is a door game I'm working on.
If you're using text-mode (Screen 0) it won't work. GET and PUT are only
for graphic mode screens (1 to 13).
If you want to save the whole screen, I'd suggest using PCOPY to stash
it away and copy it back, since Screen 0 normally has 8 pages to play
with (0 to 7).
PCOPY 0, 1 saves the current screen (0) to page 1
PCOPY 1, 0 copies it back, replacing whatever you're looking at now.
If you only want part of the screen, something like this would work:
'save 23 lines * 80 characters
DIM chr(23, 80)
DIM col(23, 80)
'Save the screen characters and color info
FOR q1 = 1 TO 23
FOR q2 = 1 TO 80
chr(q1, q2) = SCREEN(q1, q2, 0) '0 = ASCII code
col(q1, q2) = SCREEN(q1, q2, 1) '1 = Color "attribute"
NEXT q2
NEXT q1
'Restore the screen characters and color info
FOR q1 = 1 TO 25
FOR q2 = 1 TO 80
c = col(q1, q2)
COLOR (INT(c / 128) * 16) + c MOD 16, INT(c / 16) MOD 8
LOCATE q1, q2: PRINT CHR$(chr(q1, q2));
NEXT q2
NEXT q1
* SLMR 2.1a *
--- Maximus 3.01
* Origin: The BandMaster, Vancouver, B.C., Canada (1:153/7715)SEEN-BY: 633/267 270 @PATH: 153/7715 140/1 106/2000 1 379/1 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
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™.