Page 1 of 1
Test for text
Posted: Sat Jul 31, 2004 11:42 pm
by Heliostrapolis
I need to know if there is a way to test any point on the screen to see whether or not it contains text. In other words, display a text file on the screen and then pick a random point and return either true or false if that point contains text. Even if it returns what letter it contains . . . Help?
Wow...
Posted: Sat Jul 31, 2004 11:50 pm
by Levi
pretty advaned, maybe anyway. Yeah I'm sure there is a way. More than likely it would take purposly setting text in a certain format and comparing where in the file you are to what should be appearing on the screen along with size of each character box and pixel positioning.
I don't have any direct code for this of course. SO I'm sorry I can't be of much help. However I did see something of this sort once in an HTML creator someone made for QB. They had the program call up the dir function in the shell to search for certain types of files to convert to HTML, or was it finding an HTML page for editing? Oh well, then it allowed you to click on the name and it would get the name that you clicked on and open the file. I of course have no idea where this program is. But if gives you hope and something to look for.
Got It
Posted: Sun Aug 01, 2004 1:14 am
by Heliostrapols
Simple answer
Use the screen FUNCTION
thanx anyway
Posted: Sun Aug 01, 2004 10:43 am
by Pete
Here's a little bit information on this...
If you'd like to check the printed character at screen position (1, 1) -- not pixel (1, 1), but row 1, column 1 of text -- you'd do this:
Simple as that. The SCREEN function will spit out ASCII codes, instead of a simple character of text like you'd expect. So, if you've got a "0" in position (1, 1), the PRINT SCREEN function will give you the number 48. (You first have to PRINT "0" at (1,1). If this is the first thing you print when your program begins, it will be there by default.)
It might be easier if you do this:
That will return the actual ASCII character.
I don't know what happens if you check for an ASCII character at a screen position where you don't already have something PRINTed there... You might get an error, or it might just return an empty variable. Experiment and you can find out!