Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpcupt1!hpcllla!hpclisp!hpclscu!shankar From: shankar@hpclscu.HP.COM (Shankar Unni) Newsgroups: comp.lang.pascal Subject: Re: Conformable Arrays Message-ID: <950004@hpclscu.HP.COM> Date: 21 Dec 87 23:32:39 GMT References: <1472@cartan.Berkeley.EDU> Organization: HP ITG/ISO Computer Language Lab Lines: 51 > > 2) Probably most importantly, are conformable arrays standard ? Cooper > says something about Level 1 and Level 2 Pascal. What finally happened ? > Yes, there is an ISO standard for pascal that has things called "Conformant Arrays". The syntax is as follows: TYPE myarr = array [1..5] of mytype; (* say *) VAR myvar : myarr; PROCEDURE proc (VAR myparm : ARRAY [lowbnd..highbnd : INTEGER] of mytype); BEGIN ... (* you can access "lowbnd" and "highbnd" as read-only variables here, for example as loop indices *) ... END; ... BEGIN proc (myvar); (* this passes myvar as the actual array, and 1 and 5 as lowbnd and highbnd, respectively *) END; > > 1) How do you pass part of an array, like in fortran ? The fortran > code below passes the segment a(5),a(6),a(7) (or even more, I know). > What is the analogy in Pascal. I tried to get it from Cooper's books, > but it wasn't clear. > > real a(10) > call sub(a(5),3) > > subroutine sub(a,n) > real a(n) > ..... As far as I know, there is no good, clean way to do exactly this in Pascal. ----------------------------------------------------------------------------- Shankar Unni Unix Mail: shankar@hpclscu , shankar%hpclscu@hpda HPMAIL: SHANKAR UNNI/HPUNIX/UX Telnet: 1-447-5797 -----------------------------------------------------------------------------