Appearance
Field.AsInteger
Declaration
property AsInteger: Integer;
Example
pascal
procedure OnMapEvent(var Value:Variant);
begin
Value := Dataset['myfield'].AsInteger; //the value of myfield is returned as an Integer
end;Description
Returns the value of the Field object as an Integer (Integer, Cardinal, Int64). If the field is null then zero will be returned.
It is recommended that you use this property when referencing Integer type fields. This will help you avoid issues with null values causing arithmetic operators and numeric functions to fail.
If you need to convert an Integer type field to a string you can safely use the Field.AsString property. Alternatively use a Conversion or Formatting function and this AsInteger property.