DIAdem Help

Method: CStr for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: CStr for VBS

Converts an expression into the Variant type with the String subtype.

vCStr = Object.CStr(expression)
ObjectVBS
Object with this method. You do not need to specify this object.
expressionVariant
Specifies any expression.
vCStrVariant
Receives the converted value. During conversion the CStr method considers the locale settings of your computer, for example decimal points and thousands separators.
Depending on the data type of the input data, the CStr method returns different values.
Data type of expressionReturn
BooleanString with "True" or "False".
DateDate in the short date format of your system.
NullRun-time error
EmptyEmpty character string "".
ErrorString with the word "Error" and the error number.
Numeric valueString with the numeric value

The following example converts numbers into string values and links them:

Dim MyDoubleA, MyDoubleB
MyDoubleA = 123
MyDoubleB = 0.456
Call MsgBox(CStr(MyDoubleA) + CStr(MyDoubleB)) ' Returns 1230.456
Call MsgBox(MyDoubleA + MyDoubleB)             ' Returns 123.456

See Also

Objects Overview

Related Topics

Abs | Asc | AscB | AscW | CBool | CByte | CCur | CDate | CDbl | CInt | CLng | CSng | CStr | ChrB | ChrW | Chr | Escape | Fix | Hex | Int | Oct | Sgn | UnEscape

Log in to get a better experience