Test for text
Test for text
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...
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.
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.
Later days,
Matthew
May those who love us love us
And those who don't
May the good Lord turn their hearts
And if he doesn't
May he turn their ankles
So we'll know them by their limping
-Irish prayer
Matthew
May those who love us love us
And those who don't
May the good Lord turn their hearts
And if he doesn't
May he turn their ankles
So we'll know them by their limping
-Irish prayer
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!
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:
Code: Select all
character$ = SCREEN(1,1)
It might be easier if you do this:
Code: Select all
character$ = CHR$(SCREEN(x,y))
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!