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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ae9451f54a74fd7b X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: array question Date: 1999/01/19 Message-ID: #1/1 X-Deja-AN: 434346789 References: <78189o$2bj@eng-ser1.erg.cuhk.edu.hk> <7819qk$cbj@drn.newsguy.com> Newsgroups: comp.lang.ada X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Date: 1999-01-19T00:00:00+00:00 List-Id: bill@nospam.com wrote in message <7819qk$cbj@drn.newsguy.com>... >In article <78189o$2bj@eng-ser1.erg.cuhk.edu.hk>, ycli6@se.cuhk.edu.hk says... > >> i want to ask a question in array. >>type MY_ARRAY is array(INTEGER range <>) of FLOAT; >> >>what is the meaning of <>, also can i replace INTEGER with >>other type? such as FLOAT, BOOLEAN? >> > ><> means the range is undertmined at type declaration time. >when you then define a variable this type, then you need to specify >the range. This way you can use the same type to define different >objects of that type of varying ranges. so you dont have to have >to declare a new type everytime where is the only difference >between them is the value of the range. this is called generic type. > This is not correct. Such a type is called an _unconstrained_ array type. >yes, you can change INTEGER above. this is the type of the index. which >can be any scalar type. This is wrong. Array indices can be of any _discrete_ type. This means that the real scalar types are _excluded_ > >check some of the Ada text books for examples. > >bill >