By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!> Is there any way to abort a command line FOR command which runs a batch
> file? I
> keep getting the "abort batch file" prompt and after answering "Y", the
> FOR loop continues.
>vefatica wrote:
>
>
>---Quote---
>> Is there any way to abort a command line FOR command which runs a batch
>> file? I
>> keep getting the "abort batch file" prompt and after answering "Y", the
>> FOR loop continues.
>---End Quote---
>How are you trying to abort it?
vefatica wrote:
How are you trying to abort it?
> Is there any way to abort a command line FOR command which runs a batch
> file? I
> keep getting the "abort batch file" prompt and after answering "Y", the
> FOR loop continues.
vefatica wrote:
Can you give me the exact FOR syntax and batch file you're running?
I'm unable to reproduce the problem here with the FOR loop continuing.
>
> Quote:
> Originally Posted by *rconn* View Post <showthread.php?p=600#post600>
> vefatica wrote:
> Can you give me the exact FOR syntax and batch file you're running?
>
> I'm unable to reproduce the problem here with the FOR loop continuing.
>
> I already gave the exact command. Here it is again.
>
> v:\> for /l %z in (1601,1,2008) agetodate.btm %@makeage[%z-02-28]
> 1601-02-28 00:00:00
> [snip]
> 1644-02-28 00:00:00
You didn't provide the batch file contents.
>
> Quote:
> Originally Posted by *rconn* View Post <showthread.php?p=602#post602>
> You didn't provide the batch file contents.
>
> > v:\> for /l %z in (1601,1,2008) agetodate.btm %@makeage[%z-02-28]
> > 1601-02-28 00:00:00
> > [snip]
> > 1644-02-28 00:00:00
>
> Actually I did post it in the Sparklist forum. I'm going to try to
> attach it (seems to have worked!). Just in case I'll paste it below.
> It's cryptic for speed.
>
> I use a plugin @ISLEAP[] (=365|366). You'll need this:
>
> function isleap=`%@if[%@eval[%1 %% 4] NE 0 .or. (%@eval[%1 %% 100] EQ 0
> .and. %@eval[%1 %% 400] NE 0),365,366]`
> on break quit 3
>
>which will catch every ^C, return a 3 to the FOR, which will then abort
>the loop. (FOR *always* aborts the loop if the target command returns a 3.)