CStr Function

Named Arguments

No

Syntax

CStr(expression)


expression

Use: Required

Data Type: Any

Any expression that evaluates to a string.

Return Value

expression converted to a string.

Description

Returns a string representation of expression.

Rules at a Glance

  • Almost any data can be passed to CStr to be converted to a string.

  • CStr is equivalent to the older Str function.

Example

Dim sMyString as String
SMyString = CStr(100)

Programming Tips and Gotchas

  • The string representation of Boolean values is either True or False, as opposed to their underlying values of and –1.

  • Uninitialized numeric data types passed to CStr return "0".

  • An uninitialized date variable passed to CStr returns "12:00:00AM."

See Also

Format Function, Str Function, Chapter 3
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.56.28