IBM Lotus Symphony


CStr Function [Runtime]

Converts any numeric expression to a string expression.

Syntax:

CStr (Expression)

Return value:

String

Parameters:

Expression: Any valid string or numeric expression that you want to convert, as shown in the following table.

Table 1. Expression types and conversion returns
Expression type Explanation
Boolean : String that evaluates to either True or False.
Date : String that contains the date and time.
Null : Run-time error.
Empty : String without any characters.
Any : Corresponding number as string.

Zeros at the end of a floating-point number are not included in the returned string.

Error Codes

5 Invalid procedure call

Example:

Sub ExampleCSTR

Dim sVar As String

Msgbox CDbl(1234.5678)

Msgbox CInt(1234.5678)

Msgbox CLng(1234.5678)

Msgbox CSng(1234.5678)

sVar = CStr(1234.5678)

MsgBox sVar

end sub


Product Feedback | Additional Documentation | Trademarks