AsInteger0
property AsInteger0: Integer read write;
Example
procedure ScriptEvent(var Value: Variant);
begin
Locals['OptionalCount'].AsString := ' ';
Value := Locals['OptionalCount'].AsInteger0;
end;
Usage
AsInteger0 returns zero when the variable is blank; otherwise it returns the same value as AsInteger. Assigning it sets AsInteger.
Additional Technical Info
The getter reads AsStringTrim; empty returns 0, otherwise it reads AsInteger. The two accesses lock separately, so the decision and conversion need not observe the same Value under concurrent writes.
Nonempty invalid/overflowing content also returns zero because AsInteger catches conversion errors. Empty, invalid and real zero are therefore indistinguishable.
The setter delegates to AsInteger, storing a raw Integer while bypassing Value validation and encryption. On encrypted variables the precheck can decrypt while the following raw conversion sees ciphertext.
Created 2026-07-15