|
|
我写的一个程序想实现在IObuffer中的MU按时刻表exit,若需要exit的时候IObuffer中没有MU,那一旦IObuffer中有MU就立即exit。IObuffer的名字是zhuZhan,程序如下:8 V5 p2 L; y% j
is
, b' a8 M4 ~! r+ L1 _1 |4 vdo 4 h" ~: g9 W3 |5 L6 m6 E- t
waituntil EventController.simTime = Schedule[now_depart_num];% ^6 [+ K* {. j# `
if zhuZhan.empty = false
5 _% {2 s. R) U& r$ J: x# x then - b2 | R7 k& N$ e9 P2 w
zhuZhan[1].move();
6 C% S, G8 x$ i' I7 S' i$ ?" t now_depart_num = now_depart_num + 1;
8 O5 @" M/ ~0 F( m else
0 l4 d# V4 V" c/ w0 [/ h9 f. z waituntil zhuZhan.empty = false;
& R2 S2 c: w/ i: i/ |! a7 q3 c5 E zhuZhan[1].move();
( S' }' [; i, u2 s" J now_depart_num = now_depart_num + 1;
) U- L2 ?+ _. y7 v# M end;
9 ]& }8 T0 N: {end;+ t% [, q% A J
5 V0 [* x6 w$ t. U/ B: Y; \1 Z
但是一直说有错误,提示信息是:access to tables is not allowed within a waituntil statement. D1 W0 M1 g6 q" J' o/ V
若是增加一个局部变量,如下:; f4 a7 R+ C2 L! N: d% a4 Y3 F/ q
is
" J3 j) u8 k9 f5 V/ y: a depart_time : time;. P3 K, P) G8 R% y# O3 L
do
( M2 \/ n! F( @$ l% C. h* j- y depart_time := schedule[now_depart_num];
' U; D Y% x: ] waituntil EventController.simTime = depart_time; : G7 _0 W0 o7 S- o) d3 ^
。。。. {5 `2 Z7 k. m
又会出现syntax error near line 5 at <;>!& [4 S7 R3 d1 q0 }5 Y
4 k# h+ V8 _' R( E5 w0 p I各位大侠帮帮忙,或者教我怎么改程序的错误,或者教教我用别的方法实现我的目的,谢谢了! |
|