本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑
3 m: B' }% H* F+ H& ]$ Z* x- G( A' @ g, d" t
下面的程序如何修改可以实现?
1 V0 k w7 e- EC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG
( ~) ~9 f% h2 \4 X; S# w( x! otreenode item = parnode(1);
- G8 G+ Q: J3 p& ?+ b" ?! }8 ltreenode current = ownerobject(c);
2 {, {- r7 s! ]3 n/**Conditional Port*/; w7 n% V4 A( g6 `- c1 g1 k
/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/( @! d) |3 ]0 g& ?
/** \nCondition: */
0 T/ b- x6 \# \# N7 gint condition = /**/1/**/;/** \nPort if Condition is true: */7 C( F, W& |0 [7 V1 \. j9 F5 W
int port1 = /**/1/**/;/** \nPort if Condition is false: */
2 ], Z. A) e; }% p0 {0 y4 ~; Jint port2 = /**/2/**/;
1 M. b# |1 }) l2 z7 ]if (condition)- x; \1 v' m, V9 Y; J
return port1;: y* p3 o* S. f: z' u
: N3 b# s Z+ Z z, o1 Q# S
return port2; |