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,546b2e2a44f83809 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Gnat For use at Question Date: 1996/07/11 Message-ID: #1/1 X-Deja-AN: 168309473 references: <4s2eb5$qt6@masala.cc.uh.edu> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-07-11T00:00:00+00:00 List-Id: Spasmo asks why GNAT rejects: "Some_Array : String(1..4000); for Some_Array use at 16#bbbbb#;" GNAT rejects this because it is plainly illegal. Address, in accordance with the implementation ad vice in the Ada 95 RM is a private type in GNAT, and you obviously can't use an integer literal as the value of a private type. Look up the facilities in System.Storage_Elements to find out how to do what you want. Rememeber that GNAT implements the restriction that the address expression must be a prior defined constant, so you cannot just use To_Address directly, since a call to To_Address is not static. So you want something like: Some_Array_Address : constant Address := To_Address (16#bbbb#); Some_Array : String (1 .. 4000); for Some_Array'Address use Some_Array_Address; P.S. since almost certainly what you have in mind is overlaying the display buffer, it would be much neater to have an Ada variable with more structure (something like a two dimensional array of records containing an attribute which is a packed record and a character).