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

# VarToWideStr

## Declaration

`Function VarToWideStr( const V : Variant) : WideString`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := VarToWideStr(Field.Value);
end;
```

## Description

Converts a Variant type variable or field to a string. If the Variant is null then it will return a blank string.

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