Skip to content

Flow documentation · legacy product

VarToStrDef ​

Declaration ​

Function VarToStrDef( const V : Variant; const ADefault : string) : string

Example ​

pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := VarToStrDef(Field.Value, 'abc');
end;

Description ​

Converts a Variant type variable or field to a string. If the Variant is null then the default value will be returned.

This is more commonly used with Variant type variables rather than fields. When accessing fields you can achieve the same thing by using the Field.AsString property, however it is necessary to use with Fields if you want a default value.