Value & parentheses when doing math
Richard Gaskin
ambassador at fourthworld.com
Mon Apr 2 18:08:52 EDT 2018
Knapp Martin wrote:
> I have a tab delimited list where item 4 is a number and I'm adding
> things up. What is considered best practice when doing this?
>
> add item 4 of line x of tList to tRunningTotal
> or
> add (item 4 of line x of tList) to tRunningTotal
> or
> add value(item 4 of line x of tList) to tRunningTotal
>
> Marty
IMO whatever is the easiest to write and read that gets the job done is
the best option.
The first example above seems simplest to me.
The second one isn't bad, but the third one should be avoided unless you
have something in the data that requires the overhead of adding a call
to the value function.
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list