Performing math on points
Richard Gaskin
ambassador at fourthworld.com
Wed May 28 00:09:00 EDT 2003
erik hansen wrote:
> --- Richard Gaskin <ambassador at fourthworld.com>
> wrote:
>
>> 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
>
> this looks useful.
> what does tCounter do?
It counts each iteration through the loop so you know which item you're
working with. It works better when the code's not as FUBAR as originally
written -- s/b:
function AddPoints pPointsListA, pPointsListB
put 0 into tCounter
repeat for each item n in pPointsListA
put n+(item tCounter of pPointsListB) 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