GetOrderResponseStatusCode
Function GetOrderResponseStatusCode(const aOrderResponseStatus : Variant) : Variant;
Example
procedure ScriptEvent(var Value: variant);
begin
Value := GetOrderResponseStatusCode(1); // 'Accepted'
end;
Usage
GetOrderResponseStatusCode converts a Velox order-response status number to its canonical code.
Parameters and result
| Item | Type | Description |
|---|---|---|
aOrderResponseStatus | Variant, const | Numeric order-response status. Supply one of the listed integral values in a compatible Variant. |
| Result | Variant | Canonical code string in a Variant, or Null for a null or unrecognized value. |
Complete mapping
| Number | Code |
|---|---|
1 | Accepted |
2 | Rejected |
3 | Changed |
Behaviour and edge cases
- With Velox's default loose
NullEqualityRule,Nullfollows the explicit null branch. The rule is shared across the Velox process; strict or error settings can alter or break that comparison. - Unknown comparable values return
Null; they do not raise a domain-specific error. - Use the listed integral values. Do not rely on Variant coercion from strings, floating-point values or booleans.
- Arrays, interfaces and other incompatible Variant values can raise comparison or ordinal-conversion errors, which propagate.
- Identical numbers or labels used by another status/type family do not make the domains interchangeable. Use the function for the field's actual semantic family.
Additional Technical Info
GetOrderResponseStatusCode converts a numeric order-response status to the canonical Velox code. Its complete mapping is compiled into the product and is not read from customer configuration.
Implementation
The source first evaluates aOrderResponseStatus = Null, then uses a case over the listed constants. A recognized value returns its literal code and the else branch returns Null. It performs no database query or configurable alias lookup.
Side effects, errors and performance
For supported input the function is pure, performs no I/O and runs over a small fixed mapping. Variant comparison/conversion failures propagate.
Related entries
GetOrderResponseStatusNumperforms the reverse conversion.- Embarcadero:
System.Variants.NullEqualityRule - Free Pascal:
NullEqualityRule