Promotic
WikipediaLinkedInYoutubeTwitterFacebook

CStr - function of language VBScript

Description:
Returns an expression that has been converted to type String.

For the purposes of PROMOTIC system, it is more usefull to use the method: Pm.StringFormat.

Syntax:
CStr(expression As Variant) As String
Calling:
s = CStr(expression)
Parameters:
expression(Variant) Any valid expression. The value in expression specifies what is returned according to the following table:
Boolean - a string containing true or false
Date - a string containing a date in the short-date format of your system
Null - a runtime error
Empty - a zero-length string ("")
Other numeric - a string containing the number
Note:

The conversion functions can be used e.g. if you want some operation result to be expressed as a particular data type (rather than the default data type). For example, use CStr to force the result to be expressed as a String.

You should use the CStr function to provide internationally aware conversions from any other data type to a String type. For example, different decimal separators are properly recognized depending on the locale setting of Windows system.

Example:
VBScriptSelect and copy to clipboard

Dim nDouble, sString
nDouble = 437.324
sString = CStr(nDouble)  'sString contains "437.324"
PROMOTIC 9.0.0 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice