Re: Need help with user-written routine in SOR$
briggs_at_encompasserve.org
Date: 01/04/05
- Next message: John Smith: "Re: More on Tru64"
- Previous message: Hoff Hoffman: "Re: VMS and digital cameras"
- In reply to: hoefelmeyer_at_hotmail.com: "Re: Need help with user-written routine in SOR$"
- Next in thread: Dave Froble: "Re: Need help with user-written routine in SOR$"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 4 Jan 2005 15:09:21 -0600
In article <1104867989.968799.157870@c13g2000cwb.googlegroups.com>, hoefelmeyer@hotmail.com writes:
> Cool! The structure wrapper must be needed by VMS for some reason,
> then. I was just worried that it was something significant that was
> glossed over in the docs. Well, that makes it a lot easier for me! I'm
> very pleased to have my fears proved groundless. Thank you very much!
>
> A couple of other questions come to mind, with passing pointers -
> first, since ADRS1 and ADRS2 are pointers to my records, if I
> dereference them and modify non-key fields in them in my user_equal
> routine, it would indeed change the actual record, correct?
I think that would be invoking undefined behavior. There is no way
to know whether you are being handed an actual record or merely a
copy thereof.
> I know the
> answer in C, but am not sure in BASIC, i.e., is my function accessing a
> pointer to the actual record, as does C, or is it a pointer to a local
> copy of the record? The latter doesn't seem likely.
Since the record is being passed by reference, you know that you will
be modifying storage owned by the caller. But what the caller will
do with that modified storage is not documented.
It seems likely that the caller will, in fact, pass you a pointer to
his "live" copy of the record and that changes you make will actually
make it to the output file. Unless, of course, you are using a tag
sort, in which case the behavior might be different.
> And if I can, would doing so make the sort choke? I don't see why,
> because I'm not changing keys, but you never know. I'll check this out
> empirically.
The empirical approach is a good choice. Just beware of trusting the
results. Undocumented and unsupported behavior can change without notice.
John Briggs
- Next message: John Smith: "Re: More on Tru64"
- Previous message: Hoff Hoffman: "Re: VMS and digital cameras"
- In reply to: hoefelmeyer_at_hotmail.com: "Re: Need help with user-written routine in SOR$"
- Next in thread: Dave Froble: "Re: Need help with user-written routine in SOR$"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|