本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑 5 H0 D" Z/ r' M, o
. s+ s& z* M3 `( k7 V
下面的程序如何修改可以实现?
8 G2 \, A/ T# P! j7 r0 S, VC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG
, p! U+ B: V/ r5 c0 l3 streenode item = parnode(1);9 M9 O$ U* c" V2 ~
treenode current = ownerobject(c);& F. D3 n2 r) ^
/**Conditional Port*/
. E8 |5 j$ I# [2 @! P$ E0 s+ s/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/
4 w+ y6 z: P5 X2 Z. I+ c/** \nCondition: */
9 W9 ?+ A! t3 i: X$ t4 r" rint condition = /**/1/**/;/** \nPort if Condition is true: */$ v5 `2 Q, z$ U* B
int port1 = /**/1/**/;/** \nPort if Condition is false: */
3 N3 I5 q& i/ j7 H, Dint port2 = /**/2/**/;
' s% L' a7 P( A7 Oif (condition)
2 W! O: t$ Y: [7 c- |, S4 \: M. z return port1;; l7 k8 ~# T7 f( ]; s
; _$ }7 S! \1 K* i- v2 nreturn port2; |