comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Passing Batch File Names
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Passing Batch File Names [message #62287 is a reply to message #62286] Tue, 02 September 2008 09:57 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Does it work with multiline statements such as

for i=0,10 do begin &$
print,i &$
endfor

which are legal for batch files?

Ciao,
Paolo


Trae wrote:
> Just in case another poor soul needs this and searches the group, here
> are the lines of code that made it work. NB: EXECUTE only accepts
> scalars as an input. Bogus.
>
> First define a batch file named batch_test.pro with the commands
>
> a=5
> b=6
> c=sin(!dpi/4.)
>
>
> Now here are the commands to read and execute it.
>
>
> file='batch_test.pro'
>
>
>
>
> openr, lun, file, /GET_LUN
> var_arr=''
> ;while not eof do begin
>
> WHILE ~ EOF(lun) DO BEGIN
> line=''
> READF,lun , line
> var_arr=[var_arr,line]
> ENDWHILE
> FREE_LUN, lun
> var_arr=var_arr[1:*]
>
> for i=0ul,n_elements( var_arr) -1ul do result=execute(var_arr[i])
>
> END
>
>
> So you can define the variable 'file' anyway you want and it can have
> as many or as few commands as you need.
>
> Thanks for the help everyone!
>
> I'm off to be quite pleased with myself for awhile! :)
>
> Cheers,
> -Trae
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Singular Value Decomposition in 3 Dimensions
Next Topic: FFT and ROTATE

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:55:22 PDT 2025

Total time taken to generate the page: 0.00198 seconds