Performing math on points

Richard Gaskin ambassador at fourthworld.com
Tue May 27 05:38:01 EDT 2003


Doug Smith wrote:

> 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?

I think you'll have to add each item separately:

  get the mouseLoc
  add 14 to item 1 if it
  add 12 to item 2 of it
  put it

If you do it a lot you could make a handy addPoints function:

  function AddPoints pPointsListA, pPointsListB
     put 0 into tCounter
     repeat for each item n in pPointsListA
        put n+tCounter into item n of tResult
     end repeat
     return tResult
  end AddPoints


-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list