对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!* @4 c& m. P8 Q2 _- d
(product:object):boolean) i0 t8 ^. b" \7 r0 [' m8 G
is4 W* Q) @5 n H0 V. Z0 N. M5 d
do
- y# l* {) q% `% W% s partstatistics.cursorX:="color";, W8 k9 ^3 E7 C, `3 o
partstatistics.cursorY:=1;6 P+ u* N; `4 b6 @- H4 @/ w: v
if partstatistics.find(product.CurrIcon) then
; S* x/ m, e7 E7 c partstatistics["number",partstatistics.cursorY]:=. X0 L! J4 j- k9 q: ^& E! O1 E
partstatistics["number",partstatistics.cursorY]+1;
" S" o2 a/ X1 L# G0 a result:=true;
' w+ ~, }. N# h& b0 S else! M) G; Z! |% k+ U- P$ R7 E+ B
result:=false;
6 ]7 f1 Z, `; n/ X7 ^6 r- S end;
, c& I. o' }- d5 j) x( `end;
! l% Q. ?) e j
8 D0 ^3 B, ?3 C% w9 a+ ` Z“partstatistics.cursorY:=1;”
7 C$ e' i- V1 l9 u, q2 M这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。
: \* ~( m0 C: ^ g) Q" u但它的结果是在五行里统计出各种颜色的数量。 |