本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑
' j$ u6 g7 N& H ]) k1 H% O4 h1 ^5 n: t
下面的程序如何修改可以实现?
* X: \4 x" {; ]8 t d2 zC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG# e- z5 x$ b& i
treenode item = parnode(1);
1 w7 ^0 d0 |9 N6 Gtreenode current = ownerobject(c);
4 B! c/ ]: ]3 A* Z/ Y6 B% s+ D$ B4 J/**Conditional Port*/ r& R) M0 W1 l& Z1 E# G
/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/
9 [! n0 h, h9 b+ P7 q/ E/** \nCondition: */2 P: @% a5 n" t p2 w* i
int condition = /**/1/**/;/** \nPort if Condition is true: */
, y1 `1 j# [5 h2 c8 s9 qint port1 = /**/1/**/;/** \nPort if Condition is false: */
; Q! A, L5 n: }, T( d5 Sint port2 = /**/2/**/;
3 M' V, ]1 ~7 Tif (condition)
* z3 p2 w5 y' A( Y+ O P: t return port1;
( C7 v: v2 x( ~' G- E) [: L: \+ Q% u
return port2; |