对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!
# b# p' J _/ S! g! }3 e0 ^(product:object):boolean
' w3 ?) f6 B# l( z. e! m! r( Xis6 U8 v0 E- a- C7 a: E& |
do
" |3 H# C+ t/ W0 B W partstatistics.cursorX:="color";/ U8 m6 P" p1 q r6 a/ I c
partstatistics.cursorY:=1;
+ }) n" G! _, V- r if partstatistics.find(product.CurrIcon) then
* v- e, D, d# }) C1 i8 U3 E! g/ K partstatistics["number",partstatistics.cursorY]:=, a. F- z0 v/ {& {
partstatistics["number",partstatistics.cursorY]+1;
' T8 H) m8 P. a7 ?3 a, } result:=true;- B; N! n, v7 S" x" ~3 I
else [$ F# v: W6 |8 n( C8 j
result:=false;2 _! f4 z& E$ `! q, ]
end;0 g9 f- g/ V% t& R
end;
; s, v- n) ]; h- E8 o7 Q1 k# v- A5 x/ `0 M; i
“partstatistics.cursorY:=1;”) M7 |( i; r3 H2 B& _ x
这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。
5 ^0 s$ [1 G& u3 H: P" o但它的结果是在五行里统计出各种颜色的数量。 |