对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!
, i4 c0 \6 ~. _8 Q+ v! o0 l f/ x7 o. T# ](product:object):boolean$ N6 M5 |% F' z7 @
is- Z! ~+ q6 a, z- ~: `
do1 ?! `5 T& J: i0 O
partstatistics.cursorX:="color";
$ Q: y% v+ O, G( r partstatistics.cursorY:=1;
: {. ~6 s& x0 G' O3 _5 x if partstatistics.find(product.CurrIcon) then
' c8 B4 }: `6 ~ partstatistics["number",partstatistics.cursorY]:=
) v" k2 r. n( s9 y8 \8 I! ]0 _ partstatistics["number",partstatistics.cursorY]+1;8 \5 R2 u: H5 ~" a8 l% {7 j
result:=true;6 X, n6 b1 b ]) ^" q. ]" F& e
else+ h. u, G/ N: X- A. v6 C5 e
result:=false;
: B' P1 C( f! { end;- y% _; t7 b, d! e
end;
9 f, H, d h7 H# u( A0 E' y4 x2 I2 u- F, r! H3 f! W
“partstatistics.cursorY:=1;”
+ i" D" P0 `" c! l" n, x这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。9 C) _; N9 u( y+ {* \, H, g- W
但它的结果是在五行里统计出各种颜色的数量。 |