主题:  谁能告诉我下面的错误是什么意思!

雅痞公子

职务:普通成员
等级:3
金币:-3.0
发贴:732
注册:2003/3/27 23:16:34
#12003/9/6 23:56:31
谁能告诉我下面的错误是什么意思:
Error Diagnostic Information
An error occurred while evaluating the expression:
ThisMerchID=ListGetAt(CLIENT.CartMerchList, i)
Error near line 31, column 11.
--------------------------------------------------------------------------------
In function ListGetAt(list, index [, delimiters]) the value of index, which is 4, is not a valid index for the list given as a the first argument (this list has 3 elements). Valid indexes are in the range 1 through the number of elements in the list

The error occurred while processing an element with a general identifier of (CFSET), occupying document position (31:5) to (31:58

错误发生在练习时写的购物车.
购物车是这样的:进入购物车后,在用户所购物品旁有一个表单,在表单里输入数字就会改变物品的个数,也就是说如果在表单里输入"0"就是删除物品.如果一次只删除一件物品,或同时更新几件物品的个数都不会出现错误.
但一次要删除多件物品,就会出现上面的错误(也就是说同时在多件物品的表单中都输入"0"时发生的).

有兴趣帮个忙的朋友就看下代码(不是很长):








































你的购物车没有物品!

















你的购物车物名列表




    数量:
    
    

    






s22

职务:版主
等级:4
金币:10.0
发贴:1634
注册:2004/12/19 13:06:46
#22003/9/8 12:40:43
你的LIST里只有3个元素,你的I的value是4,所以报错了。对付这中问题就是把 list 跟i 一起都DUMP出来。看看就知道问题出在哪里了。



雅痞公子

职务:普通成员
等级:3
金币:-3.0
发贴:732
注册:2003/3/27 23:16:34
#32003/9/9 3:08:24
谢谢!问题解决了,我改了一种方式.