|Home||How To||Online Documentation||Support||Download||Order|
long asLong( )
operator long( ) const;
operator long() substitute asLong method to provide quick access for object's value.
If the value of current object is NULL, asLong method returns 0. Use SAValueRead::isNull method to make sure if the value is NULL or not.
If the value's type of current object is long ( SA_dtLong), asLong method returns the original value with no conversion.
If the value's type of current object is bool (SA_dtBool ), short (SA_dtShort ), double (SA_dtDouble) or numeric (SA_dtNumeric), asLong method converts it to long data type. Note, that in this case the returned value can be truncated.
If the value's type of current object is string (SA_dtString), asLong method tries to convert it to long ( SA_dtLong) value. If the conversion is possible and correct, asLong returns SA_dtLong value. If conversion is incorrect asLong method throws an exception.
If the value's type of current object is any data type except the described above, the result is undefined and debug version asserts.
Use SAValueRead::DataType method to get the value's type of SAValueRead object.
Server specific notes
No specific information.
Problems and Questions
If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to firstname.lastname@example.org.