QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: hanness on March 26, 2021, 06:02:37 pm
-
I know that I can use "Location" to move my cursor to any row and column on the screen so that I can display characters in specific locations. However, once I move to a particular location, is there any way that I can somehow retrieve the current character at that location?
Failing that, is there a way that I can simply dump the entire contents of the QB64 program screen to a text file? If so, I can then simply parse that text file to find what characters are in various spots.
-
X and Y being the coordinates you're checking.
-
X and Y being the coordinates you're checking.
Note: this is only guaranteed to work in SCREEN 0. Text screens store info in memory in 2 bytes per color&character. All other screens only store info on a color per pixel basis, so character information has to basically be retrieved via OCR — which is quite limited in QB64.
-
Really want to be fancy use MEM functions. Or be cool and old skool using DEFSEG and PEEK!
Steve can help with the fancy stuff, I could show you the old skool way.
Or you can be boring and take the beaten path. :)
-
And for graphics you can setup virtual screen array.
Modify your print command to write in both screen and virtual screen.
-
Thanks!
-
Turns out that I am using screen 0 so this works perfectly.
My program sets up a bunch of information on the screen by using locate commands to put various elements in exactly the right spots. After everything is displayed I use a simple loop to capture each character and print it to a file as you have shown me here. That file can then be printed as a really good duplicate of the screen contents.
Thanks again.