Skip to main content

IsStringType

function IsStringType: Boolean

Example

procedure ScriptEvent(var Value: variant);
begin
if Field.IsStringType then
Value := Field.AsStringTrim
else
Value := Field.Value;
end;

Usage

IsStringType reports whether the field DataType belongs to Velox's fixed string, memo or GUID set.

Additional Technical Info

IsStringType returns true only when DataType is one of:

ftString, ftWideString, ftMemo, ftWideMemo,
ftFixedChar, ftFixedWideChar, ftGuid

The list includes GUIDs because Velox treats their field representation as string-like. It does not include every type that can produce AsString; for example, formatted memo/vendor CLOB types, byte fields and numeric/date types return false unless their exact TFieldType appears above.

This method is independent of IsNullEmpty, which converts every field to trimmed text, and independent of IsNumericType. Use it when the fixed Velox category is the desired rule, not as proof that text conversion is safe or lossless.

The test is constant-time, does not access the current value and has no dataset side effect. It requires a valid live field object.

External references

Created 2026-07-15