Name

VarToStr Function

Syntax

function VarToStr(const V: Variant): string;

Description

VarToStr converts a Variant to a string. If V is Null, VarToStr returns an empty string. VarToStr is a real function.

Tips and Tricks

The only difference between calling VarToStr and simply assigning a Variant to a string variable occurs if the Variant is Null. Assigning Null to a string would result in runtime error 15 (EVariantError).

See Also

Null Variable, String Keyword, Variant Type, VarIsNull Function

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.