concatenating files [message #2906] |
Thu, 13 October 1994 06:00  |
darren
Messages: 5 Registered: March 1994
|
Junior Member |
|
|
Hi All, Does anyone know an easy way to concatenate several
files (WAVE programs and functions) into one big file, so that it can
all be compiled with a single ".run" command?
Thanks. -Darren Orbach
|
|
|
|
RE: concatenating files [message #2993 is a reply to message #2906] |
Thu, 13 October 1994 11:17   |
mallozzi
Messages: 60 Registered: August 1994
|
Member |
|
|
| darren@rockvax.rockefeller.edu writes:
| Does anyone know an easy way to concatenate several
| files (WAVE programs and functions) into one big file, so that it can
| all be compiled with a single ".run" command?
I somtimes use the following for IDL on a VAX, but I guess it should work
on other platforms as well:
Create a file that looks like
.run PRO1
.run PRO2
.run FUNCTION1
.run PRO3
MAIN_PRO
where the last line is an IDL call to MAIN_PRO, where MAIN_PRO is your main
code (that you made into a procedure) that calls PRO1, PRO2, etc
Then define an operating system symbol, that for VAX would look like
RUNNIT == "$IDL_DEV:[IDL_DIR]IDL MY_DEV:[MY_DIR]MY_FILE"
Typing RUNNIT at the DCL prompt invokes IDL, compiles PRO1, PRO2, etc
and begins executing MAIN_PRO
Does that help?
mallozzi@ssl.msfc.nasa.gov
|
|
|
RE: concatenating files [message #3049 is a reply to message #2993] |
Wed, 19 October 1994 09:40  |
landers
Messages: 45 Registered: May 1993
|
Member |
|
|
In article <37jtjt$lfr@hammer.msfc.nasa.gov>, mallozzi@ssl.msfc.nasa.gov writes:
|> | darren@rockvax.rockefeller.edu writes:
|> | Does anyone know an easy way to concatenate several
|> | files (WAVE programs and functions) into one big file, so that it can
|> | all be compiled with a single ".run" command?
|>
|> I somtimes use the following for IDL on a VAX, but I guess it should work
|> on other platforms as well:
|>
|> Create a file that looks like
|> .run PRO1
|> .run PRO2
[...snip]
Here's a program I use in PV-WAVE to compile an entire directory full of
stuff. This .RUNs each file, and executes COMPILE to save a *.cpr file.
It's done for each *.pro file in the current directory.
It also makes a file named compileall.com that has all the compile
instructions in it (so next time, you just need to run that).
For all you poor IDLers, you can probably modify it (take out the COMPILE) and
use it to generate the compileall.com file.
To use it, just CD to the directory with your programs, and do:
@make.com
(assuming make.com is in the !Path)
------ make.com -------- snip here ------
; make.com
; Run this by CD'ing to the directory you're compiling and then type:
; @<whatever-path-needed>/make.com
; This will generate and execute a compileall.com to .RUN & COMPIILE
; all the .pro's in the current directory.
; ***WARNING*** This will DELPROC,/All and DELFUNC,/All - deleting any
; programs that are currently compiled.
; Also, it makes a file named compileall.com in the current dir.
; Procedure:
; loop thru the files, strip off the '.pro', run them, and compile them:
; Delete all functions and procedures between each so we can get all
; the needed subroutines with the /All keyword.
; Note that everything is .RUN'ed twice - this is to support recursion
; in functions that are embeded in files with a different name as the
; routine
save_quiet = !Quiet
!Quiet = 0 ; turn on .RUN noise, so we can watch it go....
; get all the .pro files
files = FINDFILE( '*.pro', Count=count )
; build a compileall.com program to compile everything in this directory
OPENW, lun, /Get_Lun, 'compileall.com'
FOR i = 0L, count-1 DO BEGIN $
file = STRMID( files(i), 0, STRLEN( files(i) ) - 4 ) &$
PRINTF, lun, 'DELPROC,/All' &$
PRINTF, lun, 'DELFUNC,/All' &$
PRINTF, lun, '.RUN ' + file &$
PRINTF, lun, '.RUN ' + file &$
PRINTF, lun, 'COMPILE,/All, file="' + file + '"'
;ENDIF
PRINTF, lun, 'DELPROC,/All'
PRINTF, lun, 'DELFUNC,/All'
FREE_LUN, Lun
; Now run the file to compile everything
@compileall.com
!Quiet = save_quiet ; back to user's normal
; Get rid of internal variables
DELVAR, save_quiet, files, count, Lun, file
;END
----- make.com ---- END
Dave
PS - Sorry if this gets posted twice (or more), but my NNTP host is
having anxiety attacks....
|
|
|