对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!! v8 B: u$ G2 G
(product:object):boolean
6 ]) W, x6 e" K! j; P, L9 ~is
, w4 {$ P( `+ O8 E. H5 kdo% H4 s' o2 u3 \
partstatistics.cursorX:="color";: \* O5 ]& k9 K% S2 N" o q
partstatistics.cursorY:=1;4 d- _) U7 ~/ b* h: }7 e5 {, |
if partstatistics.find(product.CurrIcon) then0 v& x6 n6 Q/ p% ^0 A1 w* ^3 }( R
partstatistics["number",partstatistics.cursorY]:=* _, n4 b9 f# u0 F6 f1 O) t
partstatistics["number",partstatistics.cursorY]+1;" {2 U- Y' ?: \/ ^& i1 `) p) T% G/ g
result:=true;
1 A' b1 j H6 N# p; G6 L else
5 x- H8 K# X; S7 r& e* M result:=false;
- W; i0 ~4 k1 N4 t( x, W end;
) u ?7 K& P2 dend;
9 E: o% I' q" q- \4 s& Z# o& D5 ?+ ?3 |% `9 j* @
“partstatistics.cursorY:=1;”
2 Q, X: _. b8 ^7 k, B这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。* M) ]! n4 h! Q- Y- ~3 R
但它的结果是在五行里统计出各种颜色的数量。 |