Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys
Any of you have any ideas of how I could resolve this issue in my script. Basically I have loop comparing qvds from different dates. Sometimes it doesn't exist (qvd not found), then I'd like to start the loop from the beginning again. There's probably a quite easy solution to this but I'm not to used to working with loops 😕
let NoOfRows =NoOfRows('DateSpan');
let vConcat = 'OrderComparison:';
For i = 0 to '$(NoOfRows)'-1
let filename = peek('Date',$(i),'DateSpan')';
$(vConcat)
Load
fields
from orders_$(filename).qvd (qvd);
if ScriptError=8 then
next i
end if
;
Comparing orders to previous day's orders to find cancelled orders, but if no file is found I'd like the script to start over with the next iteration, but my solution above combining ScriptError and "if" returns a syntax error.. Apparantly the "next i" part that is incorrect as I can replace i with "exit script" and the script stops if the file isn't found.
let filename = peek('Date',$(i),'DateSpan')'-1;
concatenate(OrderComparison)
Load
fields
from orders_$(filename).qvd (qvd);
let vConcat ='concatenate(OrderComparison)';
next i
I'd appreciate any ideas that could push me in the right direction from here.
Thanks,
// Max
I solved my problem by including the next load statement in the if...end if statement. It's not as pretty as I imagined in my head though 🙂
Well you've got a few things in there that I don't really understand, but if you put this statement below in the beginning it will ignore errors and keep reloading:
SET ErrorMode=0;
Hi Trent,
I know, it's hard to write it down in an easy way..
I do use errormode=0 already, but the thing is that I do not want to do that second concatenation load since it will mess up the content in the file if the first load goes into error due to missing file.
That is why I want the ScriptError to initiate the next iteration in the "For/next" loop.
I solved my problem by including the next load statement in the if...end if statement. It's not as pretty as I imagined in my head though 🙂