comp.lang.ada
 help / color / mirror / Atom feed
From: cosc19z5@Bayou.UH.EDU (Spasmo)
Subject: Re: Gnat For use at Question
Date: 1996/07/19
Date: 1996-07-19T00:00:00+00:00	[thread overview]
Message-ID: <4sml29$phu@masala.cc.uh.edu> (raw)
In-Reply-To: dewar.837096600@schonberg


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





  reply	other threads:[~1996-07-19  0:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-11  0:00 Gnat For use at Question Spasmo
1996-07-11  0:00 ` Robert A Duff
1996-07-11  0:00 ` Jerry van Dijk
1996-07-11  0:00 ` Robert Dewar
1996-07-19  0:00   ` Spasmo [this message]
1996-07-11  0:00 ` Jon S Anthony
1996-07-11  0:00   ` Robert A Duff
1996-07-12  0:00   ` Laurent Guerby
1996-07-13  0:00     ` Jerry van Dijk
1996-07-15  0:00     ` Spasmo
1996-07-12  0:00   ` Jon S Anthony
1996-07-12  0:00   ` Robert Dewar
1996-07-12  0:00   ` Spasmo
1996-07-15  0:00   ` Jon S Anthony
1996-07-15  0:00     ` Spasmo
1996-07-15  0:00     ` Robert Dewar
1996-07-15  0:00     ` Jerry van Dijk
1996-07-15  0:00   ` Jon S Anthony
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox