[Info-vax] Command Procedure pass value to program READ
Arne Vajhøj
arne at vajhoej.dk
Mon Feb 7 11:09:12 EST 2022
On 2/7/2022 10:51 AM, HCorte wrote:
> Is there a way when a program is run in the context of a command procedure to pass a value/string for the READ statement in case of FORTRAN.
> This way avoiding the user to manualy insert in the terminal a filename for example or someother parameter.
>
> script.com
> $!example
> $! DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
> $RUN PROGRAM_EXAMPLE
> ---inject the input value to the READ FILENAME---
>
>
>
> program_example.for
> IMPLICIT NONE
> CHARACTER*60 FILENAME
> ....
>
>
> WRITE(*,*) 'ENTER FILE NAME:'
> READ(*,*) FILENAME
> C write(*,*) 'File Name is: ',FILENAME
> ....
$!** keep this outcommented ** DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
$ RUN PROGRAM_EXAMPLE
foobar.dat
$
$! continue with whatever
should work.
Arne
More information about the Info-vax
mailing list