对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!( f' F6 H; K0 l3 U$ [$ G) r
(product:object):boolean
; d. m) \2 n. `. P. r3 I* ]+ {/ \is
! L0 n5 G" q2 v6 A5 a+ Tdo
3 Q1 t# g0 N4 N partstatistics.cursorX:="color";
1 }/ C) ~, t9 ~6 y% X4 R' F partstatistics.cursorY:=1;
' c1 s7 U0 x. X; c* h if partstatistics.find(product.CurrIcon) then, s1 Y: t5 S& K$ r; x& {4 l, U9 }
partstatistics["number",partstatistics.cursorY]:=# h8 M) F% i6 g: Y
partstatistics["number",partstatistics.cursorY]+1;
7 y7 k( C8 ^" @; p6 D result:=true;9 ]! q$ e0 x4 q. P: I8 t7 r
else
: e# J O4 @2 l& e% }' K+ O result:=false;, A* s, q6 |! _: ~- }
end;# _% Q# f) {. ?
end;: i2 R" d# J8 E0 N5 J3 T5 D
5 u) C0 u( M3 s2 o3 T
“partstatistics.cursorY:=1;”, N! b* H( g+ o; p: N+ O0 ~, V
这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。
8 F9 ]" B- A# m: S, o0 O但它的结果是在五行里统计出各种颜色的数量。 |