April 30, 2024, 12:01:23 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


mouse over cordinates

Started by TexasPete, March 07, 2010, 04:46:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TexasPete

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

LarryMc

March 07, 2010, 05:51:45 PM #1 Last Edit: March 08, 2010, 07:03:24 AM by Larry McCaughn
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=300
based 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 numbers
should 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

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

TexasPete

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.