Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!wuarchive!wugate!uunet!mcvax!sunic!enea!sommar
From: sommar@enea.se (Erland Sommarskog)
Newsgroups: comp.lang.misc
Subject: Re: VAR vs. IN/OUT
Message-ID: <181@enea.se>
Date: 13 Aug 89 21:14:55 GMT
Organization: Enea Data AB, Sweden
Lines: 22

Richard Pattis (pattis@june.cs.washington.edu) writes:
>  The equivalent of Pascal's non-VAR mode (which is rarely needed) can be

Depends on what you mean. For efficiency VAR gives better result,
but VAR/non-VAR is the only way to distinguish between IN parameters
on the one hand and OUT and IN OUT parameters. Good programming
style is to only use VAR for the latter two cases. Only when
efficency is a problem IN parameters should be passed with the
VAR mechanism. (Or if you like me is using VAX-Pascal and CDD.
(Commin Data Dictionary) When you declare a quadword field in
the CDD, this is expanded in Pascal to an empty record with the
size attribute of 8 bytes. This type must always be a VAR parameter.
As a vaule parameter, this always results in a zero being passed. 
Have you ever such a stupid !"#$%&/() behaviour?)

But, of course, as well already have noted, this bitching with
passing mechanism isn't something the programmer should be
burdend with (and least of all a beginner). He should only be
concerned about the semantical meaning: IN, OUT or IN OUT.
                     -- 
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se
"Hey poor, you don't have to be Jesus!" - Front 242