|
|
我写的一个程序想实现在IObuffer中的MU按时刻表exit,若需要exit的时候IObuffer中没有MU,那一旦IObuffer中有MU就立即exit。IObuffer的名字是zhuZhan,程序如下:6 Z0 Q0 z% M' ?; k4 o" ~# i/ L1 y
is 3 i+ \; n8 P! C
do
" g Z. ^9 X0 z+ n6 Y: Q8 @! R0 J2 L waituntil EventController.simTime = Schedule[now_depart_num];
0 l, w W1 i) l5 U( k6 @ if zhuZhan.empty = false6 l) e5 m1 s6 E
then
+ G+ n3 \. f, \1 @4 b. `: y6 r* h zhuZhan[1].move();
+ K4 `- E0 C7 y now_depart_num = now_depart_num + 1; * g+ M$ R6 c- c% e: ~
else9 e4 h+ |, f1 D" {" A! q
waituntil zhuZhan.empty = false;
) p' M2 e( ^* ~0 q+ U zhuZhan[1].move();
8 E7 d, A5 w- M now_depart_num = now_depart_num + 1;
% G/ B _6 j3 K( A end; 9 w5 j! n4 ^1 I( Q
end;
N6 W3 s" T! w( w1 H% l
1 S* E' E+ `6 u' w# z0 }( o但是一直说有错误,提示信息是:access to tables is not allowed within a waituntil statement. + S$ a& P5 s4 _! ]9 R
若是增加一个局部变量,如下:
( E0 e n- ^* ~5 ?is
: O& V! V" l, K! t" {# E4 | depart_time : time;# W! a7 I1 `: d6 Y c- y/ G- K/ u) N8 @
do
2 L* J q9 Y# \5 I8 I; i5 S3 e depart_time := schedule[now_depart_num];9 j4 `3 S- L6 p# e
waituntil EventController.simTime = depart_time; . j! k5 r& U& @% z% {! z3 D1 F
。。。
8 T4 C: g+ [1 x8 z, L; M( r又会出现syntax error near line 5 at <;>!# P$ g# x$ t7 `, M
. @' I( _ Q- K( c各位大侠帮帮忙,或者教我怎么改程序的错误,或者教教我用别的方法实现我的目的,谢谢了! |
|