Performing math on points

Klaus Major klaus at major-k.de
Tue May 27 05:37:01 EDT 2003


Hi Doug,

you cannot add 2 different numbers to 2 other numbers in one operation.

The engines sees:

put (345,23 + 14,12) into vResult

and produces an error, of course (i would, too, in this case ;-)

> I want to take the mouseLoc and add a variable such as 14,12 to it and 
> store it in another variable.
> Trying the statements below in the multiline message box:
>  
> put the mouseLoc + 14,12 into vResult
> put vResult
>  
> produces this error message.
> Message execution error:
> Error description: Operators +: error in left operand
> Can this be done and if so, how?

put (item 1 of the mouseloc + 14) & "," & (item 2 of the mouseloc + 12) 
into vResult
put vResult


You have to:
1. add the pixels to the "mousev" and "mouseh" in different operations 
and
2. construct the correct string to store it in vResult

Now you can use vResult since it stores a correct location (x,y).

Hope that helps...


Regards

Klaus Major
klaus at major-k.de




More information about the use-livecode mailing list