for-nextステートメントは,条件がfalseになるまで式を繰り返し実行します。for-nextステートメントのオプション式を使用すると,for-nextステートメントの実行中に初期設定や値を変更できます。
一般にループが繰り返される回数は,カウンタによって決まります。
for ( [初期化式] ; [条件式] ; [ループ式] )
式1;
式2;
next;
なお,ネストするfor-next構造体の数は,255以内に抑えてください。
DEFINE
{
integer WINH,count,length;
float SLEEP_TIME=0.5;
string s1,s2;
integer i,sloop_cnt = 0;
integer sloop_max = 30;
}
...
...
sloop_cnt=1;
AIT_LogMessage("Searching for Active windows - For");
for(; sloop_cnt < sloop_max ;sloop_cnt = sloop_cnt + 1)
if (AIT_FocusWindow("Unpacking", "#32770",0.0) > 0)
if(AIT_FocusWindow("Unpacking Installable Software...", "#32770", 0.0) > 0)
AIT_LogMessage("Unpacking Installable Software... is opened");
sloop_cnt= 0;
AIT_Sleep(SLEEP_TIME);
endif;
endif;
AIT_Sleep(SLEEP_TIME);
next;