Skip to main content

ErDivideByZero

ErDivideByZero = 15

Example

function IsDivisionByZero(const ErrorType: TIFException): Boolean;
begin
Result := ErrorType = ErDivideByZero;
end;

Usage

ErDivideByZero represents both integer and floating-point divide-by-zero exceptions translated by the Velox scripting runtime.

Formatting and exception state

ExceptionToString ignores Param and returns the Velox scripting resource text divide by Zero, including its historical capitalisation. An explicit RaiseException(ErDivideByZero, ...) creates the same category but no Velox EDivByZero/EZeroDivide object.

Additional Technical Info

ErDivideByZero is member ordinal 15 of TIFException, the script-visible declaration that is kept in exact ordinal alignment with PascalScript's runtime TPSError. Its sidebar position 21 is alphabetical navigation metadata and is not its enumeration value.

ErDivideByZero is the single VM category used when PascalScript catches either Delphi EDivByZero (integer division) or EZeroDivide (floating-point division). The runtime tests both exception classes before its broader EMathError and generic Exception branches, so the two native classes deliberately collapse to this one script-visible value. The caught native exception message is saved in ExceptionParam, and the native exception object can be retained for host-side re-raise. Script code sees only the TIFException category and parameter; it cannot recover the original Delphi class from this constant.

Behavior, recovery and quirks

  • Floating-point exception masking and the operation used can affect whether Velox raises EZeroDivide or produces an IEEE value. The constant documents translation after an exception occurs, not a guarantee that every floating zero divisor raises.
  • Do not use exception handling as normal denominator validation. Check predictable zero values before the operation when local recovery is possible.
  • Any mutations completed before the failing calculation remain in place unless the surrounding API supplies its own transaction.
  • Exception transfer is not a database, dataset, filesystem or external-system transaction. Any earlier side effect remains unless the called API or surrounding Flow provides an explicit rollback contract.
  • Do not persist the numeric ordinal as an integration contract. Store the member name, formatted message, parameter and relevant procedure/position with the Velox version.

Related Code Library entries

External references

Created 2026-07-15