对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!7 k9 h( u3 p3 ~- }' A# d
(product:object):boolean% \5 i& s" c" m5 T/ J) N% F, x
is; b, J5 ?' u$ e7 t
do! A! H! c4 a4 @, j# c
partstatistics.cursorX:="color";. Y" |& j; _# y3 e
partstatistics.cursorY:=1; ~8 T ]; n% J, y" J
if partstatistics.find(product.CurrIcon) then' c6 V/ t% \+ {+ C* `3 r; b
partstatistics["number",partstatistics.cursorY]:=2 c) v" O( x3 Q0 E0 i2 B
partstatistics["number",partstatistics.cursorY]+1;* \! S+ [( w5 U7 Q. V
result:=true;: k/ `! x1 d9 G' m7 ^
else
, L/ K' O8 d9 x" [) F1 O5 H result:=false;
* F- l: H e1 P- @. n end;9 n D7 e9 k2 U- x N! f1 H
end;
[- ^; k6 K% M1 A- k# |, x* n) t. N8 J' j. ~; U4 _9 @' N
“partstatistics.cursorY:=1;”
! D1 I" F. {: N, h7 m5 L2 g这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。, E, [4 T/ ~, `
但它的结果是在五行里统计出各种颜色的数量。 |