[Info-vax] Fortran problem with QIO
John Wallace
johnwallace4 at yahoo.co.uk
Wed Dec 2 16:09:27 EST 2009
On Dec 2, 8:24 pm, Steven Schweda <sms.antin... at gmail.com> wrote:
> gerr... at no.spam.mail.com wrote:
> > It was my understanding that the %DESCR built-in function was always good
> > whenever there was something to pass "by descriptor". Now I'm starting to
> > think that that is correct only if "something" is a character string and not
> > something else. Am I right? I'm just perusing $DSCDEF in FORSYSDEF.TLB and
> > I'm wondering about its contents and what I have to pass to $QIO[W]...
>
> I haven't done any Fortran since it stopped being FORTRAN,
> but I wouldn't trust %DESCR to build a good descriptor for
> some odd-ball data structure. (It's the default for
> CHARACTER, as I recall, and it works fine there.) Knowing
> nothing, I'd build my own descriptors, and pass them in (by
> reference/address) myself. But my judgement could be warped
> by too many years using C, where that's all I can do.
>
> > You are Crazy!
> > Nobody does that.
> > [...]
>
> Probably true. And there's also my favorite function,
> FOR$RAB(), which lets you play with all the RAB/FAB/... stuff
> after a normal OPEN. (I wish that C had one like it.)
Trust, but verify. For non-mainstream uses of descriptors, let the
compiler build the descriptor, and then have a look what it built. If
inappropriate, either adjust the source to find something that makes
it obvious (to the compiler) what's going on, or failing that, build
it by hand (or build a function to build them by hand).
I quite like the idea of accessing blocks in a file using block level
stuff, but for record level stuff, there are alternatives....
More information about the Info-vax
mailing list