comp.lang.ada
 help / color / mirror / Atom feed
From: gvc@ocsystems.com (G. Vincent Castellano)
Subject: Re: Simple Ada-95 Question (regarding X11Ada bindings)
Date: 1997/01/27
Date: 1997-01-27T00:00:00+00:00	[thread overview]
Message-ID: <1997Jan27.165642.14195@ocsystems.com> (raw)


% QUESTION:
% How do I make something of type access A actually point to the
% first element in an array of A's?
% ---------
% 
% I have found out that if I take 'Address on a variable of type
                                  ^^^^^^^^
Do you mean 'Access here?

% A that is declared as aliased I get something of the right type.
% I would like to do that  with the first element in the array,
% bu I can't make that aliased..
% 

You need to declare an 'array of aliased' objects, as illustrated
by the following declarations and call to a procedure with a
simlar interface:
   
       type Vector_Of_Point_Type is array (X11.Signed_Int range <>) 
          of aliased X.Xlib.XPoint;
   
       Points:  Vector_Of_Point_Type := ((C.X1, C.Y1),
                                         (C.X2, C.Y1),               
                                         (C.X2, C.Y2),
                                         (C.X1, C.Y2),
                                         (C.X1, C.Y1));
   begin
       X11.XLib.XDrawLines(
           Display,
           X11.Drawable(C.Gw.Window),
           C.Gw.Gc_Always,
           Points(Points'First)'Access,
           Points'Length,
           X11.Coordmodeorigin);
   
 == G. Vincent Castellano :: X/Ada WWW => http://www.ocsystems.com/xada ==
 ==  "If virtual memory did not exist, it would have                    ==
 ==     become necessary for us to invent it."                          ==




             reply	other threads:[~1997-01-27  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-27  0:00 G. Vincent Castellano [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-01-20  0:00 Simple Ada-95 Question (regarding X11Ada bindings) Ralf Lundberg
1997-01-27  0:00 ` Keith Allan Shillington
replies disabled

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