Article View: mod.computers.apollo
Article #378Re: Apollo Pascal Question
From: nazgul
Date: Sat, 21 Feb 1987 00:10
Date: Sat, 21 Feb 1987 00:10
30 lines
1860 bytes
1860 bytes
In article <333589cd.44e6@apollo.uucp> Kevin Buchs <kevin@zeke> writes:
>
> Question -- I need to access command line arguments in pascal -
> why can't I do it in one step as this example shows?
...
> argv : pgm_$argv_ptr;
...
>
> { why can't I de-reference the structure in one step
> as this line does ??
>
> ******* bad line ***** - error = argv not a pointer ******
>
> writeln(argv^[i]^.chars[1]);
>
> }
argv is a pointer to an array of univ_ptr's. Those in fact do point
to pgm_$arg's, but of course you can dereference a univ_ptr, you have
to assign it to something else. The real solution is probably to define
your own type which is a pointer to an array of pgm_$arg pointers and
use that.
"But wait," you say, "why wasn't it done that way in the first place?".
Because the original thought was that you might want to pass things other
than strings to programs (e.g. some arbitrary data or strange data
structure). In fact no one (to my knowlege) has ever used this ability,
but the data structures still allow for it.
-nazgul
Technical Details
Message-ID:
<8702210050.AA24301@EDDIE.MIT.EDU>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ucbvax!nazgul@EDDIE.MIT.EDU@apollo.UUCPReferences:
<333589cd.44e6@apollo.uucp>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ucbvax!nazgul@EDDIE.MIT.EDU@apollo.UUCP From: nazgul@EDDIE.MIT.EDU@apollo.UUCP Newsgroups: mod.computers.apollo Subject: Re: Apollo Pascal Question Message-ID: <8702210050.AA24301@EDDIE.MIT.EDU> Date: Fri, 20-Feb-87 19:10:26 EST Article-I.D.: EDDIE.8702210050.AA24301 Posted: Fri Feb 20 19:10:26 1987 Date-Received: Sat, 21-Feb-87 19:36:39 EST References: <333589cd.44e6@apollo.uucp> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: apollo!nazgul (Kee Hinckley) Organization: Apollo Computer, Chelmsford, MA Lines: 30 Approved: apollo@yale-comix.arpa