AsInteger0
property AsInteger0: Integer read write
Example
procedure ScriptEvent(var Value: variant);
begin
Value := Field.AsInteger0 + 1;
end;
Usage
AsInteger0 reads trimmed-empty field text as zero and otherwise uses the field's 32-bit AsInteger conversion.
Additional Technical Info
AsInteger0 is a read/write 32-bit Integer convenience property.
The getter reads AsStringTrim. It returns 0 when the trimmed text is empty; otherwise it delegates to inherited AsInteger.
Database null, empty string and whitespace-only text therefore collapse to zero. Nonempty invalid text, overflow and incompatible fields are not suppressed and can raise. Large-integer values outside signed 32-bit range can also fail or narrow according to the concrete field implementation. A genuine zero is indistinguishable from the fallback unless the caller checks the original null/text state first.
The setter always executes AsInteger := Value; it does not apply the getter's empty rule. Normal field conversion, edit/read-only, validation and range behavior applies. A successful write changes the current record buffer but does not post, apply updates or commit.
External references
- Embarcadero DocWiki:
TFielddocuments typed conversions, null defaults and errors for unsuitable properties. - Embarcadero DocWiki:
Trimdocuments the empty-text test.