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 #62288 is a reply to message #62287] Tue, 02 September 2008 09:50 Go to previous messageGo to previous message
Trae is currently offline  Trae
Messages: 23
Registered: May 2007
Junior Member
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: Thu Oct 09 22:36:37 PDT 2025

Total time taken to generate the page: 0.08287 seconds