The text-mode screen (SCREEN 0) is arranged thus:
Byte 0: Ascii code of the letter to display at column 1, row 1
Byte 1: color attribute of the character at column 1, row 1
Byte 2: Ascii code of the letter to display at column 2, row 1
Byte 3: color attribute of the character at column 2, row 1
...etc.
Here is a quick example:
Code:
cls def seg = pbvscrnbuff \ &H10000 for x% = 1 to 26 poke x% * 2 - 2, 64 + x% next x% def seg
That would be done something like this (using both 32-bit pointers and seg/offet methods):
Code:
' pseudocode DIM ps AS LONG PTR, x AS LONG x = 999 ps = VARPTR32(x) OPEN "file.dat" FOR OUTPUT AS #1 ' Write it as a "text" value, ie "999" PRINT #1, @ps ' use the pointer target ' Or we could write it as 4 byte binary value (same as MKL$): DEF SEG = VARSEG(x) PRINT #1, PEEK$(VARPTR(x), LEN(x)) DEF SEG CLOSE #1
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment: