Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: if Restrict...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 5626 of 5697
Post > Topic >>

Re: if Restrict_Func /= null confusion

by Georg Bauhaus <rm.plus-bug.tsoh@[EMAIL PROTECTED] > Mar 30, 2008 at 11:44 PM

On Sun, 2008-03-30 at 13:58 -0700, ma740988@[EMAIL PROTECTED]
 wrote:

> -- used to restrict a variable within a range
> -- for example: -PI to +PI
> type Restrict_Function is access function (X: Real4) return Real4;
> 
> type Filt_Data is
>   record
>      Restrict_Func   : Restrict_Function ;
> 
>   end record ;
> 
> 
>    --  within a procedure we have
>   Fdata             : Filt_Data;
>   Restrict_Func : Restrict_Function := FData.Restrict_Func ;
> 
>   if  Restrict_Func /= null then
>    -- stuff
>   endif
> 
> At issue:  I'm not following the conditional logic 'if (Restrict_Func /
> = null)'.  Not understanding the impetus behind the check for null.

The type Restrict_Function includes the null value.
The FData.Restrict_Func record component gets the default
initial value for access values. It is therefore null.
So Filt_Data.Restrict_Func is actually null.




 1 Posts in Topic:
Re: if Restrict_Func /= null confusion
Georg Bauhaus <rm.plus  2008-03-30 23:44:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 11:03:36 CDT 2008.