Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!zaphod.mps.ohio-state.edu!wuarchive!uunet!math.fu-berlin.de!fub!geminix.in-berlin.de!tertius.in-berlin.de!gaertner From: gaertner@tertius.in-berlin.de Newsgroups: comp.lang.pascal Subject: Re: arrays Message-ID: <1991Jun20.094704.6589@tertius.in-berlin.de> Date: 20 Jun 91 09:47:04 GMT References: <1991Jun18.175558.1667@odin.corp.sgi.com> Lines: 35 In article <1991Jun18.175558.1667@odin.corp.sgi.com>, avila@swinger.csd.sgi.com (Richard Avila) writes: > In pascal on the SGI box a user wanted to create > an array type such that at compile time the > bounds ( or size of the array ) is not known. > > Then at runtime the bounds can be assigned > and the variable is created. > The current Pascal definition allows only data types which must be known at runtime. There is a new Pascal standard (Extended Pascal) under development/revision (?) which allows the dynamic assignment of bounds (as I know). This Extended Pascal has been published by IEEE (sorry, I don't know the catalog number) and may be submitted to approval to ISO. The VAX Pascal implements a lot of the features of this Extended Pascal, so the following example has been taken from the VAX/VMS Pascal Language Reference Manual. It shows the usage of the so called `Schema Types': TYPE Array_Template(Upper_Bound : INTEGER ) = ARRAY[1..Upper_Bound] OF INTEGER ; VAR Array1 : Array_Template( 10 ) ; { ARRAY[1..10] OF INTEGER ; } Array2 : Array_Template( x ) ; { Upper bound determined at run-time by variable or function call ; } I hope that this Extended Pascal will be available on a lot of machines soon. Ralf --- Ralf Gaertner gaertner@venus.rz-berlin.mpg.de FHI Berlin