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: cosc19z5@Bayou.UH.EDU (Spasmo) Subject: Re: Gnat For use at Question Date: 1996/07/19 Message-ID: <4sml29$phu@masala.cc.uh.edu>#1/1 X-Deja-AN: 168907611 references: <4s2eb5$qt6@masala.cc.uh.edu> organization: University of Houston newsgroups: comp.lang.ada Date: 1996-07-19T00:00:00+00:00 List-Id: Robert Dewar (dewar@cs.nyu.edu) wrote: : 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). Yep accessing the display buffer :). Well the reason I had the array was just to do a quick and dirty test to see if this would in fact work, although I might have kept it (C habit, forgive me :). Still since I got a segmentation fault after properly compiling this (thanks for all the help) that idea is out, but it doesn't matter to me since now I can just import the various conio functions available that will more or less do what I want. Thanks to Jerry (forgot the last name) for the sample code on that. -- Spasmo "Here's a present just for you When you open it, you'll be through" "Letter Bomb" by the Circle Jerks