如果想要让程序延迟几秒执行,可以编写如下代码:
- Local time &StartTime, &CurrentTime;
- &StartTime = %Time;
- &CurrentTime = %Time;
- While ((&CurrentTime - &StartTime) < &Seconds)
- &CurrentTime = %Time;
- End-While;
Local time &StartTime, &CurrentTime;
&StartTime = %Time;
&CurrentTime = %Time;
While ((&CurrentTime - &StartTime) < &Seconds)
&CurrentTime = %Time;
End-While;
当然也可以通过调用java实现:
- Local JavaObject &Pause;
- try
- &pSeconds = 10;
- &Pause = GetJavaClass("java.lang.Thread");
- &Pause.sleep(&pSeconds * 1000);
- &Pause = Null;
- catch Exception &NoProblemx
- &Pause = Null;
- end-try;