comp.lang.ada
 help / color / mirror / Atom feed
* How best to test for NULL in Ada?
@ 2015-07-02 22:15 NiGHTS
  2015-07-02 23:19 ` Jeffrey R. Carter
  2015-07-05 23:32 ` NiGHTS
  0 siblings, 2 replies; 6+ messages in thread
From: NiGHTS @ 2015-07-02 22:15 UTC (permalink / raw)


I have encountered several situations where I needed to test an access type for NULL or not. My instinct is to do something like this:

    if Some_Object /= null then ...

But many times I get this error:

    invalid operand type for operator "/="
    left operand has type "Some_Object_Type" defined at ...
    right operand has an access type

What is the correct way to test for NULL in Ada?


(If you want a specific example, I am trying to test if the Selected Path returned by Gtk.Tree_View.Get_Cursor in the GTK Library is valid or NULL. But situations like these occur many times in distinct situations so I'm not looking for a fix to this specific problem)


Thank you in advance for your help!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-05 23:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02 22:15 How best to test for NULL in Ada? NiGHTS
2015-07-02 23:19 ` Jeffrey R. Carter
2015-07-03  0:12   ` Randy Brukardt
2015-07-04  2:02     ` Shark8
2015-07-03  7:30   ` Dmitry A. Kazakov
2015-07-05 23:32 ` NiGHTS

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