本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑
% d( e/ r) Y# {7 f1 T* G( p
& Q( Z4 P$ N) }4 L8 d下面的程序如何修改可以实现?
% ` ?( j- f1 k: c+ t$ { KC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG/ `# O2 v) d# ~& R
treenode item = parnode(1);
1 M. S& J3 ^, ~3 @. dtreenode current = ownerobject(c);
8 t( S% u) W0 t# B. U/**Conditional Port*/
$ a) I. @+ p' C/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/1 W, S5 T0 ~ W3 W0 |9 K
/** \nCondition: */6 r' I$ X7 A& }
int condition = /**/1/**/;/** \nPort if Condition is true: *// H6 d% e) N; w# c
int port1 = /**/1/**/;/** \nPort if Condition is false: */( J5 w$ W$ o7 J) U4 W
int port2 = /**/2/**/;
. N ^0 ^" Z+ c1 C! D# V( ?7 i! Pif (condition): m, ]6 v+ r# \
return port1;. v7 W' [9 |1 O( w
' | P0 b+ A" [
return port2; |