running main file from batch script ... in a loop [message #87678] |
Sat, 22 February 2014 08:17  |
antonella.garzilli
Messages: 2 Registered: February 2014
|
Junior Member |
|
|
I was trying to run a main file from within a batch script. I have run it simply from the file, and it works, but if I try to call it from within a loop cycle I get a syntax error.
I do something like this:
n=10
for i=0, n do begin $
& .run main.pro $
& endfor
and main.pro can be something as easy as this:
print, 'hello'
end
|
|
|
Re: running main file from batch script ... in a loop [message #87679 is a reply to message #87678] |
Sat, 22 February 2014 08:29   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
antonella.garzilli@gmail.com writes:
> I was trying to run a main file from within a batch script. I have run it simply from the file, and it works, but if I try to call it from within a loop cycle I get a syntax error.
>
> I do something like this:
>
> n=10
> for i=0, n do begin $
> & .run main.pro $
> & endfor
>
>
> and main.pro can be something as easy as this:
>
> print, 'hello'
> end
Humm. Don't really know what to say, except this is "All Wrong!" What is
it, exactly, you are trying to do?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|
Re: running main file from batch script ... in a loop [message #87681 is a reply to message #87679] |
Sat, 22 February 2014 09:22   |
antonella.garzilli
Messages: 2 Registered: February 2014
|
Junior Member |
|
|
Ahahahah
because batch files are a list of commands you would insert in the command prompt, I assumed that you could just put executive commands in a batch.
I solved my problem calling a pro from a main.
Anyway I should stop using IDL, it feels too much like programming in the 90s.
On Saturday, February 22, 2014 5:29:53 PM UTC+1, David Fanning wrote:
> writes:
>
>
>
>> I was trying to run a main file from within a batch script. I have run it simply from the file, and it works, but if I try to call it from within a loop cycle I get a syntax error.
>
>>
>
>> I do something like this:
>
>>
>
>> n=10
>
>> for i=0, n do begin $
>
>> & .run main.pro $
>
>> & endfor
>
>>
>
>>
>
>> and main.pro can be something as easy as this:
>
>>
>
>> print, 'hello'
>
>> end
>
>
>
> Humm. Don't really know what to say, except this is "All Wrong!" What is
>
> it, exactly, you are trying to do?
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: running main file from batch script ... in a loop [message #87683 is a reply to message #87681] |
Sat, 22 February 2014 10:07  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
antonella writes:
> because batch files are a list of commands you would insert in the
command prompt, I assumed that you could just put executive commands in
a batch.
> I solved my problem calling a pro from a main.
>
> Anyway I should stop using IDL, it feels too much like programming in the 90s.
Yes, *especially* the way you are using it! ;-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|