From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e52f7c34095c85e5,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news-out.visi.com!petbe.visi.com!news.octanews.net!newsfeed-east.nntpserver.com!nntpserver.com!roc.nntpserver.com.POSTED!6cbb20d4!not-for-mail From: "zork" Newsgroups: comp.lang.ada Subject: unconstrained array type problems Organization: - X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: NNTP-Posting-Date: Wed, 21 Jul 2004 10:06:04 EST Date: Thu, 22 Jul 2004 01:04:13 +1000 Xref: g2news1.google.com comp.lang.ada:2318 Date: 2004-07-22T01:04:13+10:00 List-Id: Hi, i am trying to read a matrix from a text file. For instance if i want to read in a 2 x 3 matrix, my text file is set up as follows: ----- 2 3 1.0 2.4 3.5 1.2 1.1 2.4 .... I was hoping i could do something like the following (I thought an unconstrained array is the way to go since i do not know the dimensions of the array until reading the text file): ------------------ procedure Matrix is type Matrix_Type is array ( Integer range <>, Integer range <> ) of Float; .. .. begin .. Get ( File, number_rows ); -- read the number of rows from file Get ( File, number_columns ); -- read the number of columns from file array1 : Matrix_Type ( 1 .. number_rows, 1 .. number_columns ); .. end Matrix; ------------------ I cant seem to define my array1 in the begin / end block. This is a bit frustrating. How does one get around this? Is an unconstrained array the best choice? Any help most appreciated! thanks, zork