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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!BGUVM.BITNET!GDAU100 From: GDAU100@BGUVM.BITNET ("Jonathan B. Owen") Newsgroups: comp.lang.ada Subject: Question about generics Message-ID: <8905281734.AA24058@ajpo.sei.cmu.edu> Date: 29 May 89 07:02:34 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet X-Unparsable-Date: Sat, 27 May 89 16:39:21 IST List-Id: A while back I tried to define the following: generic Max_len : Integer; package VSTR is subtype Len_range is integer range 0..Max_len; type V_string( len : Len_range := 0 ) is record data : String(1..len); end record; ---------------------- -- VSTRING SERVICES -- ---------------------- function V_string_of( str : in String ) return V_string; Etc... end VSTR; The purpose of such a package is obviously to use Variable length strings having different maximum lengths. Using the about definition after an instantiation on Vax-Ada worked fine (Such as "package VSTR80 is new VSTR(80)" ). When transferring the code to Verdix Ada 3.0, on the apollo (SR 10.1), I received a compiler warning on a variable of such a type, saying that there is not enough storage for such a variable. It seems that the upper limit of len_range is not considered constant... Any ideas to overcome this difficulty? Thank you, JB ______________________________________________________________________________ (--) /--) /-(\ Email: gdau100@bguvm (bitnet) \ / /--K | \|/\ /\/) /|-\ Snail: 55 Hovevei Zion _/_/o /L__)_/o \/\__/ \X/ \_/ | |_/ Tel-Aviv, 63346 ISRAEL (/ Jonathan B. Owen Voice: (03) 281-422 Point of view: A chicken is the means by which an egg reproduces an egg. ______________________________________________________________________________