本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑 . M& G, T" T6 ?9 n- G6 Q
) `& `' L. _' r) S9 l下面的程序如何修改可以实现?$ |' F9 L: G4 G% a0 K
C:\Documents and Settings\in_qq_wang\桌面\未命名.JPG
* c* J( _! l& ^. j/ Streenode item = parnode(1);! ^1 x$ D, d% G& T" W% @/ Y
treenode current = ownerobject(c);# E% t4 ^4 _+ w* N' N% y3 p
/**Conditional Port*/9 s# [5 L$ H; ]
/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/
) b6 P4 r. p/ y) [1 p6 ^& Y- H/** \nCondition: *// t, x- G: C) ]1 d0 d0 Q @
int condition = /**/1/**/;/** \nPort if Condition is true: */
) Z! C1 E3 c8 T- {! L2 Qint port1 = /**/1/**/;/** \nPort if Condition is false: */
+ u0 d6 n, k' oint port2 = /**/2/**/;2 ?# U. n2 }; a! W" D8 d
if (condition)
7 w. \& o' I; [: x" k return port1; r2 ?- }' O O6 u" N3 u, B {. i
r7 F& D% e0 Ireturn port2; |