Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 4 of 4 total |
Expression evaluation |
Sun, Feb 18 2007 12:34 AM | Permanent Link |
Bill Edwards | If the following integer field is NULL, will the following expression evaluate as 1) false or 2) indeterminant? If ( FieldByName('ItemNo').AsInteger > 0 ) |
Sun, Feb 18 2007 7:06 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Bill
My money is on 1). Whilst the SQL standard has (IMHO) horrible things to say about null .AsInteger has to do something with it and I think that something is treat it as zero. Roy Lambert |
Mon, Feb 19 2007 6:56 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Bill,
<< If the following integer field is NULL, will the following expression evaluate as 1) false or 2) indeterminant? If ( FieldByName('ItemNo').AsInteger > 0 ) >> False because Delphi doesn't know anything about NULL values. To determine if a field is NULL, use the TField.IsNull property instead. -- Tim Young Elevate Software www.elevatesoft.com |
Mon, Feb 19 2007 2:29 PM | Permanent Link |
Sean McCall | Bill Edwards wrote:
> If the following integer field is NULL, will the following expression evaluate as 1) false or 2) indeterminant? > > If ( FieldByName('ItemNo').AsInteger > 0 ) > All the TField.AsXXX will return a value. For a null field, the value is: Boolean ==> False String ==> '' Numeric ==> 0 (This includes TDateFields which evaluate to Dec 31, 1899 or something like that) So, this expression will evaluate to False if the field 'ItemNo' is null. Sean |
This web page was last updated on Friday, April 19, 2024 at 07:09 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |