I am trying to see when the mouse is over the following coordinates over the screen and then Highlight the area in a different color.
I am translating to cb . I have isolated the fault in logic to the few lines of code below. I want it to light up if the mouse is over or between 100 and 300 across and 200
down and 500 down. Supposedly a retangular area on the screen. I have read over the book several times . I must not understand something. The original translations worked just fine.
If (MouseX =>100 | (MouseX = 300) )
If (MouseY => 200 | (MouseY <= 500) )
'-------------MAKE THE SELECTION----------
overcontrol = 1:SELECTED=ZZ:TEST$=TTYPE$[1,SELECTED]
'-------------MAKE THE SELECTION------------Then highlight the area
EndIf
EndIf
ZZ=ZZ-1
until ZZ=0
If anyone can see my faulty logic thanks
Texas Pete
Stumped by a simple rectangle
where are Mousex and mousey defined?
since you provided a minimum of information I'm assuming you're trying to use @MOUSEX and @MOUSEY
1st you don't have matching (())
If (MouseX =>100 | (MouseX = 300) ) '<== mousex equal to or greater than 100 OR MouseX=300based upon what you described you wanted to do the line should be
If (@MouseX =>100) & (@MouseX <= 300) ) If (MouseY => 200 | (MouseY <= 500) )' <== as written this is always true - mousey equal to or greater than 200 OR mousey less than or equal to 500 - that includes all possible numbersshould be
If (@MouseY => 200) & (@MouseY <= 500) )'-------------MAKE THE SELECTION----------
overcontrol = 1:SELECTED=ZZ:TEST$=TTYPE$[1,SELECTED]
'-------------MAKE THE SELECTION------------Then highlight the area
EndIf
EndIf
ZZ=ZZ-1
until ZZ=0
Quote....The original translations worked just fine.
What original translation?
LarryMc
Larry, Thank your so much , I see my error now . I was using mousex and mouseY as you surmized. It was I believe the "&" . I was trying to find the equivilent of an
"and" . In this area CB is different in the structure. I will play with it some more until I get it more firmly fixed in my mind.
Thanks
Texas Pete
When I get a small sample worked out I will post it just to help others.