How do you do a range of numbers in livecode? I tried using "-" like this
if the loc of the image "yellowdisck.png" is 0 50,0-640 then
But this doesn't work.
If you use a loc (location), you need to check the horizontal and vertical values separately. Assuming your horizontal range is 0 to 50 and the vertical range is 0 to 640 (inclusive):
put the loc of img "yellowdisk.png" into theLoc
put item 1 of theLoc into x
put item 2 of theLoc into y
if x>=0 and x<=50 and y>=0 and y<=640 then
-- true: do my stuff here
else
-- false: do something else
end if
It looks like you're trying to determine whether an object's location (its center point) falls within a rectangular area. Try using the
is within
operator: