strange error in a repeat loop
Bob Sneidar
bobs at twft.com
Mon Feb 23 11:59:36 EST 2009
Obviously the value here is not empty and is not a number.
Did you try stepping through the code and seeing what the value is at
the time you get the error?
Bob Sneidar
IT Manager
Logos Management
Calvary Chapel CM
On Feb 23, 2009, at 6:27 AM, Andre.Bisseret wrote:
> 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é
>
>
>
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list