|
我写的一个程序想实现在IObuffer中的MU按时刻表exit,若需要exit的时候IObuffer中没有MU,那一旦IObuffer中有MU就立即exit。IObuffer的名字是zhuZhan,程序如下:- o8 m& Z* r2 L g
is - f6 a( ]" W) \3 i
do 5 B* j4 h1 F9 }. V( B9 _' E
waituntil EventController.simTime = Schedule[now_depart_num];
( Z8 r) b) S9 S7 X! k2 E- A$ h) W; W; d" N if zhuZhan.empty = false
, _# R6 o' P" U4 y7 u then * ~5 f) _1 i0 O) b
zhuZhan[1].move();- z! R/ C' N+ g A3 F/ Y( X [
now_depart_num = now_depart_num + 1;
9 \5 x4 T2 j) c. s+ I9 Q! U' ~ else
# N `& Z0 X @1 h$ E2 ]) H waituntil zhuZhan.empty = false;& B/ x8 N/ T8 T# E9 ?- y
zhuZhan[1].move();
) [0 G! b, r8 I2 w" K6 ~ now_depart_num = now_depart_num + 1;
/ \" M }* @$ C, f q* M6 i& b end; . O7 P- b8 }: q# }3 K
end;* M* j3 M% u/ a; \" k9 e
4 R9 ~$ ^/ W) c# b7 B; ?
但是一直说有错误,提示信息是:access to tables is not allowed within a waituntil statement. ( |. i1 H9 v- J2 a* j) G
若是增加一个局部变量,如下:1 p3 [+ r8 V. Y0 ]
is
" s7 n' a7 `7 c! C: A depart_time : time;
5 h' P1 d# y1 Z) n+ ]" L! T" wdo
. O8 a1 k/ I: N, l# a depart_time := schedule[now_depart_num];6 V& |' @& e4 S
waituntil EventController.simTime = depart_time;
0 v P6 }: l8 N O! Q" J) ^8 v# h# w 。。。% n- ?2 s* X" ? l! Z f, R
又会出现syntax error near line 5 at <;>!
/ J# j1 d, X( ^3 r8 T: K
! B# \; a# X3 H" _8 a# L各位大侠帮帮忙,或者教我怎么改程序的错误,或者教教我用别的方法实现我的目的,谢谢了! |
|