本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑 / e$ @% U1 M" v- k
; s7 t4 {( f4 c: `6 J* g" J! G下面的程序如何修改可以实现?
( A" C& C( l# h$ h- Q" ?* l) wC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG- a5 \$ V M+ o
treenode item = parnode(1);# |; ^- l+ X1 P1 n3 u4 @& K, U
treenode current = ownerobject(c);
( q0 A- _; r% F1 S9 s8 t2 j/ }/**Conditional Port*/
/ m. c9 d8 y0 m; _* ?/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/3 z% R9 A5 I. f' o
/** \nCondition: */
1 T- G: K# M* q! c3 P7 Nint condition = /**/1/**/;/** \nPort if Condition is true: */
/ Q6 B& H% r" R1 p( x3 wint port1 = /**/1/**/;/** \nPort if Condition is false: */9 g7 ^ ]2 I5 L* Q( X; f9 }3 B* V
int port2 = /**/2/**/;7 M4 @- {/ |+ M) W$ P
if (condition)
9 i8 q8 O* c' _7 S# `, Z+ Z return port1;
6 ^1 K6 @" j+ c/ i2 s
8 y2 N- D8 n$ {) q, r1 b$ j) Rreturn port2; |