strange error in a repeat loop
Andre.Bisseret
Andre.Bisseret at inria.fr
Mon Feb 23 09:27:38 EST 2009
Bonjour,
I am completely stuck with a silly error I keep getting in a simple
handler.
Here it is :
--------------------------------------
ON totaliser
local
total5
,total6
,total7,total8,total9,totalPort,totalGéné,totalAnnul,cmdeDuMois,tLesVars
---------------------
-- EMPTY IN VARIABLES
put
"total5,total6,total7,total8,total9,totalPort,totalGéné,totalAnnul"
into tLesVars
REPEAT FOR each item meti in tLesVars
put empty into meti
END repeat
put fld "chRécapDuMois" into cmdeDuMois -- field "chRécapDuMois"
is a list with items separated by tab
-- SUM OF COLUMNS
set the itemdel to tab
REPEAT FOR each line enil in cmdeDuMois
add item 5 of enil to total5
add item 6 of enil to total6
add item 7 of enil to total7
add item 8 of enil to total8
add item 9 of enil to total9 -- THE ERROR IS POINTED OUT HERE
add item 10 of enil to totalPort
add item 11 of enil to totalGéné
add item 12 of enil to totalAnnul
END repeat
put total5 & tab & total6 & tab & total7 & tab & total8 & tab &
total9\
& tab & totalPort & tab & totalGéné & tab & totalAnnul
into fld "chTotaux"
end totaliser
------------------------------------------
For an hour now (at least) I got an error :
Error 10: add: error in source expression
Hint : repeat: error in statement
Error at char 1 of line 246 in handler totaliser
Code: 1
--------------------
this error is pointed out at line "add item 9 of enil to total9"
If I suppress (comment) this only line the handler works well (except
I don't get the total for column 9 !! ;-((
I wrote a lot of times such an handler ; first time I am stuck like
this ! I don't understand at all and have no idea.
Hoping some of you will see something (could be evident) I am missing ?
Thanks a lot in advance for any idea
Best regards from Grenoble
André
More information about the use-livecode
mailing list