|
|
我写的一个程序想实现在IObuffer中的MU按时刻表exit,若需要exit的时候IObuffer中没有MU,那一旦IObuffer中有MU就立即exit。IObuffer的名字是zhuZhan,程序如下:
5 t& K# a5 ^$ Lis
7 P( c' c$ _6 b3 {% {% D1 P Ddo
% [5 W: ?: s! V& B3 ^. i2 X! V waituntil EventController.simTime = Schedule[now_depart_num];2 T; c+ |; S& m8 f& ?
if zhuZhan.empty = false3 x# }: G8 B) P1 [$ ?: y$ u
then ; S% d! G5 H; @
zhuZhan[1].move();4 s& U9 t* `+ C K k ]+ t9 d) f
now_depart_num = now_depart_num + 1;
% X! |7 h; O4 F& E else" q" }2 B7 j0 C- T* c3 R* S7 q
waituntil zhuZhan.empty = false;
; {/ S* K; o" M: `$ [ zhuZhan[1].move();% ]6 g4 D! U; E/ }+ n, L
now_depart_num = now_depart_num + 1;# V" |6 K! Q9 L
end; + Y& G& U& T: ^! V( @$ ~
end;! g+ J n9 ^7 A- o" z5 u8 n
) S9 u z. l2 E' h8 |
但是一直说有错误,提示信息是:access to tables is not allowed within a waituntil statement. 8 R$ d# T5 }2 g7 d9 e
若是增加一个局部变量,如下:
# u, l# s" D1 C3 `is . @) d7 W1 R, T3 j2 H1 o$ P
depart_time : time;
- r2 m: S2 p( v5 x" p3 e% K4 w, jdo - {* k( p0 _. H* Y8 {' n3 }
depart_time := schedule[now_depart_num];. c' x3 Y4 W8 _8 R4 u3 I* K
waituntil EventController.simTime = depart_time;
0 C7 R _" |, r 。。。
0 l4 G) ?7 s5 l# }2 h又会出现syntax error near line 5 at <;>!4 ^. P) e" B: V i
; F* ]' B% Y. B2 Q# i' A
各位大侠帮帮忙,或者教我怎么改程序的错误,或者教教我用别的方法实现我的目的,谢谢了! |
|