本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑 % b4 Y& j: {' _6 P2 w) c
8 t$ Z1 d- D) j3 s+ `: \
下面的程序如何修改可以实现?
4 d$ r5 r) e6 M* N$ U1 K5 rC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG; D$ |/ q% P! V& K" Q
treenode item = parnode(1);) V, G( m1 h5 o
treenode current = ownerobject(c);/ z2 q- G& M4 ^+ U: I8 r1 Y
/**Conditional Port*/
2 @* K& v( ^- O1 P2 Y/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/
' P' m# g% l1 a G- `2 t$ w* T, p: m/** \nCondition: */
2 _, Z+ b e4 \int condition = /**/1/**/;/** \nPort if Condition is true: */
+ z- P4 R0 W$ {( lint port1 = /**/1/**/;/** \nPort if Condition is false: */
7 E/ B6 |( u- L; O" O6 bint port2 = /**/2/**/;
. P9 a/ W3 X1 F+ o2 {2 [- Jif (condition)) J5 B. I/ b- d( f, P
return port1;
/ i( u: {! N/ J9 b# {& H1 f
3 a& E9 _# [* [3 c& h+ \& G; R* ereturn port2; |