Skip to main content

GetPODTypeNum

Function GetPODTypeNum(const aPODTypeCode : string) : Variant;

Example

procedure ScriptEvent(var Value: variant);
begin
Value := GetPODTypeNum('CustomerPOD'); // 1
end;

Usage

GetPODTypeNum converts a Velox POD type code to its canonical number.

Parameters and result

ItemTypeDescription
aPODTypeCodestring, constPOD type code. Comparison is case-insensitive but otherwise exact.
ResultVariantMapped integer in a Variant, or Null for an unrecognized code.

Complete mapping

NumberCode
1CustomerPOD
2SupplierPOD

Behaviour and edge cases

  • Matching is ordinal and case-insensitive for these ASCII identifiers; letter case may vary.
  • The function compares the whole input and does not trim. Leading/trailing whitespace, punctuation changes and inserted spaces prevent a match.
  • Empty and unknown text return Null; numeric text is not parsed.
  • Test VarIsNull before assigning the result to a non-nullable numeric destination.
  • 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

GetPODTypeNum converts a POD type code to the corresponding Velox number. Its complete mapping is compiled into the product and is not read from customer configuration.

Implementation

The source compares the input with each literal using installed Delphi SameText, in table order. The first match returns its integer constant; the final else 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. Ordinary unmatched string input returns Null rather than raising a domain-specific error.

Related entries

Created 2026-07-15