Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

ENDIFF in for() loop in TCC36

Hello,
I've been one of your loyal customers for years (since 4OS2 and 4DOS). I just received TCC36, and I have a script that has been working for years but is now returning an “ENDIFF invalid command” error.

for %%i in (ShutAbor Shutdown ShutImme StartRes Startup) do (
set fin=%%i.sqi
set ext=sql
gosub cvt
iff not %rc == 0 then
quit %rc
else
move %fout ..\Bin | tee /A ..\Log\Create.log
copy %%i.btm ..\Bin | tee /A ..\Log\Create.log
endiff
)

Thanks.
 
Whether or not this constitutes an actual bug is a question for Rex.

I will suggest changing that FOR loop to a DO loop. FOR is inherently a single-line construct; the parentheses just smoosh all the enclosed lines together into a single line. IFF / THEN / ELSE / ENDIFF is a multiline structure. Smashing a multiline structure into a single line is probably not a good idea, even if it worked in the past.
 
Back
Top