adding a row of numbers in field
Posted: Mon Aug 03, 2015 12:58 pm
I have a tab delimited field where each row contains a name followed by hours worked for the week. How do I add the total hours worked?
Thanks,
Larry
Thanks,
Larry
Questions and answers about the LiveCode platform.
https://forums.livecode.com/
this is the important part of the answerI have a tab delimited field...
Code: Select all
...
set itemdel to TAB
put 0 into totalhours
repeat for each line tLine in fld "hours worked"
## Supposed the hours are the second item per line:
add item 2 of tLine to totalhours
end repeat
## Now do whatever you want with totalhours
...