---
url: /flow/guide/scripting-reference/functions/variant/vartype.md
---

# VarType

## Declaration

Function VarType( const V : Variant) : See [TVarType](/flow/guide/scripting-reference/data-types/enumerations/tvartype)

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
if VarType(Field.Value) = varOleStr then
Value := Field.Value;
end;
```

## Description

Tests a Variant to determine what data type its value is.

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.FieldType](/flow/guide/scripting-reference/classes/field/field.fieldtype) property.
