本帖最后由 wqqjs1 于 2010-7-7 16:35 编辑
7 i. w" n, V: Q* \4 e) |
; O/ U/ L+ O' g r5 A; t; W2 |8 v下面的程序如何修改可以实现?
* N8 F/ I& l# aC:\Documents and Settings\in_qq_wang\桌面\未命名.JPG' q1 b8 y' b% d' r" U% B( c
treenode item = parnode(1);$ {. i0 @5 u' ]
treenode current = ownerobject(c);# `- I( d& r6 ]; `7 ~% C* i
/**Conditional Port*/7 B7 P3 D6 D* C1 ]( q8 E( }
/** \nIf some condition is true (equal to 1), send to a given port. Otherwise, send to a different port.*/
2 G1 q, D9 ?2 [$ N/** \nCondition: */
- Z% p u, ~- N& f5 W9 X0 oint condition = /**/1/**/;/** \nPort if Condition is true: */8 x* S4 [ G9 f* Y Y$ \
int port1 = /**/1/**/;/** \nPort if Condition is false: */) {& H2 N/ C( ?8 c U, {
int port2 = /**/2/**/;/ |% k) c( t6 X. o/ ^
if (condition)
+ o9 ~ Q a$ }5 K" { return port1;1 i( \& t O& X0 t) w4 {% }0 a
6 Q8 R2 W0 Z: l6 t+ }2 x+ O1 Nreturn port2; |