本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑
, Y! T3 ~4 m) n+ x
+ @% Z5 D4 V( `' ` a8 E' S下面的程序如何修改可以实现?
1 x0 K4 K/ |7 o: E7 j }4 JC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG* ^7 E2 `$ Z9 A; c
treenode item = parnode(1);
2 I$ m/ ?0 U, a) a6 W( Z( dtreenode current = ownerobject(c);0 d% L; W* R C4 n, y
/**Conditional Port*/
; t0 ?9 ~% p! I8 J! v x/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/( g1 b* c6 a; l& Y2 w
/** \nCondition: */; C- B% _* S# M3 Q+ v2 ~9 @
int condition = /**/1/**/;/** \nPort if Condition is true: */* d' u; X" t) f
int port1 = /**/1/**/;/** \nPort if Condition is false: */, G# w: Y1 w5 ?- t( I
int port2 = /**/2/**/;) L4 M3 q! Y, R7 s) w
if (condition)
/ O0 Y: g8 [; U0 H9 Y' X return port1;
" t7 r P7 w, m9 B; ~9 C1 m
+ u' o9 U! M6 R" f9 @' V4 k) Jreturn port2; |