[Info-vax] Command Procedure - FORTRAN
geze...@rlgsc.com
gezelter at rlgsc.com
Wed Aug 12 14:09:23 EDT 2020
On Wednesday, August 12, 2020 at 12:50:02 PM UTC-4, HCorte wrote:
> Trying to create the following command procedure that accepts two variables from the command line and compile .f and then link .obj for a fortran program.
>
> But when reachs the line:
> FORTRAN FILENAME+".F"
> instead of replacing the variable for the inputed value that the user inserted it tries to run FORTRAN FILENAME.F instead, is there a way to make it replace the variable for its values before it runs the command: FORTRAN ???
>
> $ !compile and link script example to later on
> $ !change make a double of dfor and dlink with flag for debug mode
> $ INQUIRE DEBUG-
> "enter command to compile and link with debug mode on or off (yes or `
> $ INQUIRE FILENAME-
> "enter the file name to compile and link?"
> $ IF DEBUG .EQS. "YES"
> $ THEN
> $ WRITE SYS$OUTPUT "DEBUG MODE ON"
> $ WRITE SYS$OUTPUT FILENAME+".TXT"
> $ EXIT
> $ ELSE
> $ IF DEBUG .EQS. "NO" THEN
> $ WRITE SYS$OUTPUT "DEBUG MODE OFF:"+FILENAME
> $ FORTRAN FILENAME+".F"
> $ LINK/EXE=FILENAME+".EXE" FILENAME+".OBJ"
> $ EXIT
> $ ENDIF
> $ ENDIF
> $ WRITE SYS$OUTPUT "Invalid option only yes or no repeat the process"-
> $ +" again"
I concur with Hoff. Using F$PARSE is probably the preferred route.
Some of my OpenVMS Consultant columns (http://www.rlgsc.com/blog/openvms-consultant/openvms-consultant.html) may be of interest, in particular:
Filename Alchemy - F$PARSE Defaulting (October 18, 2010)
http://www.rlgsc.com/blog/openvms-consultant/filename-alchemy-with-fparse.html
DCL Symbols: Starting at the beginning (March 2, 2009)
http://www.rlgsc.com/blog/openvms-consultant/dcl-symbols.html
- Bob Gezelter, http://www.rlgsc.com
More information about the Info-vax
mailing list