本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑 . M- {0 ?' H3 h. o2 {* V
0 W9 o: e0 H0 o7 j7 _6 y6 x下面的程序如何修改可以实现?
" j( a! X- `& j9 B9 ~4 TC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG
$ M& e9 l8 M/ ~9 Y* D( |9 {treenode item = parnode(1);
7 j" f# F; B2 s9 n9 h; c' Btreenode current = ownerobject(c);, V( U! d1 ~: r; g2 N
/**Conditional Port*/' t' r5 y3 R4 w
/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/
6 z( ]1 s! C8 \2 {" Y( {7 S- j+ F* h/** \nCondition: */* R3 _$ j7 g% T$ v* c6 V0 d
int condition = /**/1/**/;/** \nPort if Condition is true: */
& t% |$ z% i3 M Wint port1 = /**/1/**/;/** \nPort if Condition is false: */
F3 o1 h' T4 j# [% \+ n- Yint port2 = /**/2/**/;' C# x H( m3 x; \8 Z7 j; N
if (condition)
* y2 J7 K! y( i0 _ return port1;4 M Z, G2 m; H' x. I8 K
4 n; F7 \$ M: f8 F
return port2; |