Skip to content

TypeName - Built-in Miscellaneous Function

Purpose

TypeName returns a string representing the type of the expression.

Syntax

TypeName(exp)

Arguments

Argument Description
exp Required. Any valid expression.

Returns

Variant with a VT_BSTR value

Return values:

Expression Returns
Empty, only defined variable Empty
Cint(123.4) Integer
1234.5 Double
Ccur(12.78) Currency
Now() Date
'abc' String
123456789123456789 Integer
1<2 Boolean

Example

let iTest = cint(123.456)
return typename(iTest) // returns "Integer"
if (ucase(typename(iTest)) = "INTEGER") then
    return "Integer value"
else
    return "Not an Integer value"
end

Notes

  • If you want to compare the returned value use a case insensitive compare.
  • The return value conforms to the standards for variant datatypes