|
|
我写的一个程序想实现在IObuffer中的MU按时刻表exit,若需要exit的时候IObuffer中没有MU,那一旦IObuffer中有MU就立即exit。IObuffer的名字是zhuZhan,程序如下:
; P! c% [8 H% ]! K$ yis
, N% m3 ~5 D$ t! Mdo 6 t2 c, O( B1 @" \( Z0 i
waituntil EventController.simTime = Schedule[now_depart_num];
2 ~: ]' V% c) D: P+ Q" A if zhuZhan.empty = false
. \+ l8 I: }3 y6 V- y: ^ then
) P T! N* d8 x) `5 W7 l! P zhuZhan[1].move();, Q6 W/ o) d+ f
now_depart_num = now_depart_num + 1; 4 F& ^8 H& Z: b+ j4 K- P+ P
else) ?! e4 X+ `( x8 ]9 S7 R8 \! ~
waituntil zhuZhan.empty = false;: c1 C" }6 P4 U3 ^2 _9 z3 o5 A
zhuZhan[1].move();# }; R# s8 \1 ~; H- c8 g: r
now_depart_num = now_depart_num + 1;
$ `# S: F# p& ^+ f5 y# D( W; ^' n end; ' m# D2 d1 x- F, F, c, t% \. V
end;
& {$ k5 N) _% q7 T9 C/ l9 J8 x' @
' Q' D, k1 g1 ^但是一直说有错误,提示信息是:access to tables is not allowed within a waituntil statement.
+ s* K. s6 f8 f/ T' M+ q若是增加一个局部变量,如下:. U. c5 `- R) C) x' C4 ?
is ; z$ B0 {, k9 p" C s U$ }
depart_time : time;0 u4 L+ M- h1 D }
do 9 I, m7 V4 s! ]7 M$ n
depart_time := schedule[now_depart_num];
8 t$ G* [* c/ O6 C& g7 F waituntil EventController.simTime = depart_time;
. r% } u$ q- @4 B% I 。。。/ y, E% c' k4 X/ \
又会出现syntax error near line 5 at <;>!2 f1 J! Q* j6 G' d" D
, [/ }* e; M6 k' q1 Y各位大侠帮帮忙,或者教我怎么改程序的错误,或者教教我用别的方法实现我的目的,谢谢了! |
|