[Info-vax] Fortran problem with QIO
Ken Fairfield
ken.fairfield at gmail.com
Mon Dec 7 12:00:51 EST 2009
On Dec 4, 4:44 am, koeh... at eisner.nospam.encompasserve.org (Bob
Koehler) wrote:
> In article <5ovfh5l5haviokhcnub9hlphoee7n0c... at 4ax.com>, gerr... at no.spam.mail.com writes:
>
> > It's already here, in this thread: just look at my yesterday answer to Hein
> > and you'll find the working program. :-)
>
> Yes. Once again posts cross in the night.
Coming in late to the discussion, sorry... I did
a lot of this (calling system services from Fortran)
in a past life. :-)
To the OP, you need to know that VAX Fortran
passes most arguments by reference (address),
with the exception of CHARACTER variables,
which are always passed by descriptor (as
noted by other posters).
The second thing is you need to carefully note is
for the given system service, i.e., SYS$QIOW,
check the argument passing *mechanism* and
match your call from Fortran to that.
CHARACTER arguments to system services
are almost always passed by descriptor, so
just pass a "normal" from Fortran. Scalar
arguments, especially input arguments like
falgs or bit masks, are almost alaways passed
by value, so need a %VAL(...) in the Fortran
call. Finally, arguments passed by reference,
or described as "the address of...", also need
no special treatment in the call from Fortran.
Setting up structures (item lists) can be a little
different: if a item is described as the "the
address of a word to receive...", or similar,
you'll need a %REF on the right side of the
assignment, IIRC.
Good luck! -Ken
More information about the Info-vax
mailing list