I have written one application which has three nested loops, two FOR loop and one DO WHILE then exit script and there are another tabs which have some old code. I executed below code two or three times in my script is was executed fine.
](delimiter is '/');
FOR c = 1 to NoOfRows('Temp_0')-1
FOR a = 1 to NoOfRows('TEMP')-1
let vCountry = SubField(Var,'|',2);
let vToday = num(now())-14;
let b= '42442';
Do while b <= vToday
but suddenly it was started through error which is :
The control statement is not correctly matched with its corresponding start statement
Then I deleted the tables after EXIT SCRIPT and script is started running fine.
My problem is why script is not working if there is old code after exit script ?
Thanks in Advance!
The statements after EXIT SCRIPT are still parsed to catch any pre-execution detectable syntax errors.
So that is the reason. I would rather use a block comment with /* and have the */ at the very end of the script - that way you don't need to figure out the problem with your old code.
Parsing is a good thing to be able to catch any errors as soon as possible. The disadvantages are minor ... the only thing is that you will have to use commenting instead of just EXIT SCRIPT. Why don't you correct the syntax errors? Then you can continue to use EXIT SCRIPT.
I got your point. Parsing means it looks for any syntax error. If it is not executing it will not load any script outcome data to application, it will just tell me that post exit script there is any error or not. like in my case, why my loop before exit script is failing because loop start from a=1 and post script there is a value 15 in variable a , so all time it was saying starting of loop condition won't work. I tried to set variable a definition before exit script or before any loop code but it was taking the value of variable post exit script.
Thanks Petter. from now will use /* instead of exit script.
Maybe there are some exceptions to the general rule hinted from Petter. At least in QV 10 the in this release undocumented feature of must-include was executed after an exit script statement. I don't know if this had now changed.