对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!7 P, t; t1 u" T
(product:object):boolean
' K: T5 U" F+ v3 W: L/ A+ jis
6 e+ G; k& a! _do
2 w M' {( j* y9 y" L, i* F" c partstatistics.cursorX:="color";% Y$ [, f' V7 {2 v
partstatistics.cursorY:=1;
; x; A. q* Q8 { T- n) l; P if partstatistics.find(product.CurrIcon) then
7 c8 y8 P! ]# c4 l7 d7 l+ x# g. J partstatistics["number",partstatistics.cursorY]:=) m$ D4 u9 D ?( k: t! t, e
partstatistics["number",partstatistics.cursorY]+1;
; [% [. t* p% E result:=true;
+ a) r: \# W1 r( V- i, K5 b% x else/ z, V) ~1 N, S- J% ]& k
result:=false;3 L, @* k6 F t5 [% `
end;
9 u1 ?+ k7 ]8 mend;/ j& K: d* W! x) V" h$ N
3 D- ~9 a6 x; W* i: c3 I( b; h
“partstatistics.cursorY:=1;”
$ s& s9 i f! z8 ]$ ^( R3 [这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。$ t9 z& R* s* t( o+ ]
但它的结果是在五行里统计出各种颜色的数量。 |