对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!
: K" p7 R) I5 H6 s/ u8 }! T6 M(product:object):boolean1 }" k) T. j$ i7 {- H
is( a! U$ A" J. e2 m2 z& }9 v2 E
do
, K9 W, g) k7 D b, K partstatistics.cursorX:="color";8 u, f, g. e$ P2 y9 q$ m3 t7 P7 |
partstatistics.cursorY:=1;: Q$ }' M+ y9 f- P! w
if partstatistics.find(product.CurrIcon) then; ^- `7 a) s. x6 D9 j/ |6 @
partstatistics["number",partstatistics.cursorY]:=
f0 Y" { P3 f% i) |$ v+ k( u partstatistics["number",partstatistics.cursorY]+1;
$ q5 R4 W* E. n8 N result:=true;
, Z3 {* G: J1 s1 ~ else
1 C- _% u/ t1 |+ y result:=false;
0 {1 z' ]$ C) X# O+ n# J, V end;
3 x0 y/ x, a# J3 q5 Cend;2 m' C' s% g! O0 D1 h4 X
' M. h6 p: F( Y* ~
“partstatistics.cursorY:=1;”" k6 z7 p# J2 G+ f* M8 x: F, V
这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。& ~1 X! D5 Y+ a6 `4 r) f1 x. i% A8 I
但它的结果是在五行里统计出各种颜色的数量。 |