|
第一步:
1 {0 A+ S) b8 Y3 |8 E. Xtreenode item = parnode(1);
$ a6 [( w- B. i! ~6 m. N; ytreenode current = ownerobject(c);
1 L. Z1 P2 Y) Z& B" N' qtreenode source=node("/source",model());
3 M: ^9 L$ u3 K) fint port = parval(2);
6 _% i5 m! P( |% ~' N! y# @if(
+ ^; [( q/ i" G* I9 F content(current)>=20, I1 E* c0 ^/ F7 y J- d
)' J' x( ]' m; L" A
sendmessage(source,current,1,0,0);
6 i8 I7 |/ u& x preturn 1;- N9 W+ {# _0 o s4 F* X: i* D
第二步:
6 L6 }; W9 m" H7 L- [+ m/**Custom Code*/* B, q* R8 \$ M7 m: S; [. ~* Z# B
treenode item = parnode(1);( V; q @, |' L! R
treenode current = ownerobject(c);3 u) K' ]$ x9 e7 c
treenode source=node("/source",model());* B$ Y7 ] Y4 s
int port = parval(2);
/ a3 h$ L& S! A+ j, r* b0 r3 O wif(4 s' H6 R# L! F: T$ H
content(current)<5! c0 x/ R; l" f" ?1 U. D) X: D! |
)+ g: ?- A* n$ Y- j3 Y
sendmessage(source,current,2,0,0);
7 d! f) U( ^& k# i/ V& G }% e( Zreturn 5;
, ^# D# F( g9 m! x# T- S第三步:, |- V% T& s" K7 s$ ]& v
2 x" x& ?% x9 d" V0 s6 ~% l# Z/ |
/**Custom Code*/
3 \+ {3 s2 N# H1 Z' W7 z9 _0 k% Ctreenode current = ownerobject(c);. a4 Y5 c' j& X1 a
unsingned int uservalue=(unsigned int) msgparam(1);
. u$ P, C w; h% a5 h* Rswitch(uservalue){, [7 Y" k+ o- g4 `5 O: }
case 1:closeoutput(current);break;( S' t- T3 Q) I* l/ A. ~
case 2 penoutput(current);break;# p! S( K# s3 O9 a3 {
}8 ~1 D/ s; {( I+ v
最后系统报错是第三步,说是没有定义uservalue:
5 ~8 B* c: K' P# D" T7 y2 L" d/ L K% J: k3 y
line 3 unknown variable "unsingned"
% P7 H! [8 [: e2 ^7 h% Q( g) C" }( q( o+ z$ u
line 3 syntax error, unexpected type identifier, expecting ';') p' O4 \: a2 y
Could not finish parsing because of previous errors.# W% c1 U d" x5 b
4 }# O" _0 R; Q; `请问各位大大这是怎么一回事.... |
|