|
我写的一个程序想实现在IObuffer中的MU按时刻表exit,若需要exit的时候IObuffer中没有MU,那一旦IObuffer中有MU就立即exit。IObuffer的名字是zhuZhan,程序如下:& s, }7 G# t n% A4 f& b3 C/ [4 m
is ) z; `7 A' s% [0 K6 N% u+ c- q
do
1 S' Z; ?9 A2 i$ [0 o4 T# O waituntil EventController.simTime = Schedule[now_depart_num];
6 z' h, G: V3 G) Y( c if zhuZhan.empty = false
( _; K( @- M* x4 i then
" Y& A# R1 p6 D1 @/ B zhuZhan[1].move();
) t9 g% g% G/ n3 ? now_depart_num = now_depart_num + 1;
# s7 H3 g5 i6 [# B2 g else6 W8 R6 C$ _: V, Y" a
waituntil zhuZhan.empty = false;
$ i( v4 ?& F7 ]% p- P7 { zhuZhan[1].move();
5 o# b( i, |+ a' Y now_depart_num = now_depart_num + 1;
( _) O; e) E- R- d: _( z r end; ' V$ V" \3 a+ i9 m* ~5 _
end;7 K8 P# `1 [8 m4 r0 f/ O4 \! ?
) l, u( Z d; M& E+ {" d9 k
但是一直说有错误,提示信息是:access to tables is not allowed within a waituntil statement.
# f& d. M3 m5 Q2 T$ A% ~+ k若是增加一个局部变量,如下:
# u, h0 y; l' |, x+ Q# [9 \is
0 K" e6 {- b/ v" K: {4 ~ depart_time : time;
# V/ `: A# Y; q. R7 bdo
* Z% t, q) ^" v+ d, F depart_time := schedule[now_depart_num];7 w" t8 ^, J" o* M- N5 d- q, {
waituntil EventController.simTime = depart_time; . h3 F, z6 ?& t: t8 C
。。。$ w2 P/ Y v7 {$ S# X+ a
又会出现syntax error near line 5 at <;>!
1 ^& |# m: Z2 w/ u! x6 `1 p# ~4 n- Y( Z* L8 {7 c. O% A' }
各位大侠帮帮忙,或者教我怎么改程序的错误,或者教教我用别的方法实现我的目的,谢谢了! |
|