|
我写的一个程序想实现在IObuffer中的MU按时刻表exit,若需要exit的时候IObuffer中没有MU,那一旦IObuffer中有MU就立即exit。IObuffer的名字是zhuZhan,程序如下:9 f; r, B x6 c* j/ g" a( b9 D
is 8 S! l1 {; J; @ s
do ( e6 T h8 h0 J: G9 U8 U( z/ X
waituntil EventController.simTime = Schedule[now_depart_num];
+ d5 N0 _: @( s, ]! r: e if zhuZhan.empty = false' F( N+ a# u( t1 e: t
then
1 J) z/ _- L( n zhuZhan[1].move();4 W0 ], U1 @3 g$ x4 P' D# m
now_depart_num = now_depart_num + 1; 5 ~' j( |+ c. k$ z, D! `
else; n/ D4 W' _( |' T5 Z
waituntil zhuZhan.empty = false;
3 `) Y/ r7 E( t" b z) Y4 [ h zhuZhan[1].move();% ~" }6 L' z9 L' Q3 Z8 `
now_depart_num = now_depart_num + 1;
1 K1 [ T7 x' K" O end; 1 W6 T4 c, J6 ?
end;
) D! i5 h- w, ]+ G) T9 o9 C0 F
但是一直说有错误,提示信息是:access to tables is not allowed within a waituntil statement. 7 f$ [* p. _+ B; P" q
若是增加一个局部变量,如下:" c; c* z$ P4 g6 K5 |2 X/ b
is , N2 G/ q, k% U9 Q
depart_time : time;4 G/ f. n% z% v. [2 A( K; j) \
do & \$ e* @- h4 F! H
depart_time := schedule[now_depart_num];
7 e/ J# _+ t) X3 i waituntil EventController.simTime = depart_time; 2 F; D0 g7 I* ?6 d
。。。/ U! O) U- u2 k$ d8 l0 ^
又会出现syntax error near line 5 at <;>!' q3 ~3 b7 Y. z
# z; K" k) D6 P, r1 y) m& ^各位大侠帮帮忙,或者教我怎么改程序的错误,或者教教我用别的方法实现我的目的,谢谢了! |
|