对于黄家强ppt里面的一个程序,有点不懂。求教各位大虾!
8 A: @. I. r/ s(product:object):boolean: O0 x. \+ p0 ?
is4 a" p) ^9 K, }- M% G
do
" P5 Z6 y( ~! b/ X partstatistics.cursorX:="color";
* o) h- j) j+ [' x. [9 F' R partstatistics.cursorY:=1;- m, w8 N' J6 c9 Q( h4 W8 _2 k
if partstatistics.find(product.CurrIcon) then
7 y5 t' \) Y% F# | partstatistics["number",partstatistics.cursorY]:=
5 `. K' u7 S7 E4 w5 ]+ J, M* P" F6 _% p partstatistics["number",partstatistics.cursorY]+1;
/ ^. z* v- L3 i1 J0 a, ^. M# y result:=true;% ^+ w h* u; r, r( k
else
& d, C) ?* ~. X; `4 w. D' c result:=false;
* O( w% ?+ L' J$ e: m end;
2 a: v6 v0 C5 L4 I' f0 y& h0 Cend;3 f& I( z+ Y5 ^4 G( p
' \2 m7 [2 [/ r
“partstatistics.cursorY:=1;”
1 u0 a$ I/ A! m# M& m0 E6 h这一句怎么理解,他对partstatistics.cursorY赋值为1,那么后面的partstatistics["number",partstatistics.cursorY]不就变成了partstatistics["number",1],这样只能在number这一列的第一行里统计颜色的数量了。) b: T% O5 Q* u# b! l
但它的结果是在五行里统计出各种颜色的数量。 |