|
|
我写的一个程序想实现在IObuffer中的MU按时刻表exit,若需要exit的时候IObuffer中没有MU,那一旦IObuffer中有MU就立即exit。IObuffer的名字是zhuZhan,程序如下:0 Y, |) K% Q! \% T% J3 w
is - U, l8 c: ?6 g: w1 o, _0 }
do
9 h/ q8 v. V% f2 I waituntil EventController.simTime = Schedule[now_depart_num];) E; I) |$ h, |3 M6 N% e
if zhuZhan.empty = false" a' J7 I7 a- p! \7 R; Z, Q
then
, @! I o9 N- I2 i zhuZhan[1].move();
9 ^- y# i- \; b) h" \, Q) @ now_depart_num = now_depart_num + 1; 7 @5 C: i0 ~9 o6 i* S3 I$ ~
else5 j f: A$ p) z+ J# |/ F* c
waituntil zhuZhan.empty = false;
+ K- n5 J: E3 ?4 x3 b' D. A zhuZhan[1].move();
W" t8 g) O: _7 O! z; x3 i now_depart_num = now_depart_num + 1;+ }, H Y- I( M5 d3 ^* {
end;
5 t4 t- A8 s/ A7 }7 S3 Xend;$ E8 g6 d( t8 ~% _+ g$ |/ M
* R/ J( O. g8 R! K) {, g5 p
但是一直说有错误,提示信息是:access to tables is not allowed within a waituntil statement. 0 G3 w7 ^! j% a# k# G
若是增加一个局部变量,如下:. F: \8 F7 }: n: w* I5 G
is
, }/ `1 X3 Q$ J! n8 h depart_time : time;
8 |; h- d; q9 t( s) a5 Kdo
' ^& j Z: f+ c2 n* n depart_time := schedule[now_depart_num];
4 x+ W0 x% V! U+ { waituntil EventController.simTime = depart_time;
$ W/ z/ g4 t0 W# _% t# h' M$ u 。。。
3 o2 ]) `, [, p+ n又会出现syntax error near line 5 at <;>!1 B3 A' v4 `# }% _( ?
' n2 V- V6 W+ j1 @) L7 }各位大侠帮帮忙,或者教我怎么改程序的错误,或者教教我用别的方法实现我的目的,谢谢了! |
|