🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.modula2
1 messages
1 total messages Started by sam Tue, 25 Aug 1987 04:53
runtime bounds on arrays
#3771
Author: sam
Date: Tue, 25 Aug 1987 04:53
21 lines
1405 bytes
Can anyone out there tell me whether there is any form of dynamic arrays
in Modula-2?  Specifically, if it will only be known at run-time how large
a certain array needs to be (it is given as user input, or something), can
you do something like
     PROCEDURE p(N:CARDINAL);
       VAR x:ARRAY [0..N] OF  ...blah...
and simply pass the required size of x as the parameter to p?  I can find
nothing in Wirth or any other reference I can find saying that you cannot,
and the syntax allows it.  It seems like such a common situation that I
cannot imagine that the language would prevent me from doing it, yet the
compiler I have barfs when I try (admittedly it is an experimental
compiler).  So which is broken, the compiler or the language?

Thanks in advance for your help.

-- 
                              -Sam Weber

UUCP: {ihnp4 utzoo decwrl uw-beaver}!utcsri!sam
ARPA: sam@csri.toronto.edu
CSNET: sam@toronto
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads