Function syntax
Posted: Fri Mar 05, 2010 11:59 am
I tried to pass two integer number (lets call them xx and yy) to a handler (they are the coordinates of a point on the screen.
Lets call the handler MoveItThere
I have then a button with the following handler
I was expecting this to work. But it does not. The MoveItThere handler considers that there is only one passed parameter and that it is a point: i.e. two values separated by a coma are in xpos, the second parameter ypos is empty.
Although the workaround is easy, this behaviour seems strange as the comma is normally the itemdelimiter for parameters and that Revolution supports multiple parameters passed to functions or handlers...
Is this new or am I missing something.
I am using rev 4.0 but I believe this did not happen in 3.5 (I have deleted 3.5 from my machine)
Lets call the handler MoveItThere
Code: Select all
on MoveItThere xpos, ypos
set the loc of graphic "littlecircle" xpos/2 &","& ypos/2 -- put the graphic half-from the xpos ypos original position
end MoveItThere
Code: Select all
on mouseUp
put 320 into xx
put 450 into yy
MoveItThere (xx,yy)
end mouseUp
Although the workaround is easy, this behaviour seems strange as the comma is normally the itemdelimiter for parameters and that Revolution supports multiple parameters passed to functions or handlers...
Is this new or am I missing something.
I am using rev 4.0 but I believe this did not happen in 3.5 (I have deleted 3.5 from my machine)