CByte - function of language VBScript

Returns an expression that has been converted to the value of the Byte type.
In the PROMOTIC system it is better to use the Pm.Round method (or Pm.Trunc, Pm.ToNumber).
Byte CByte(Variant expression)
expression(Variant) Any valid expression.
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 CByte to force value of the Byte type in cases where single-precision, double-precision, or integer arithmetic normally would occur.
Use the CByte function to provide internationally aware conversion from any other data type to the value of the Byte type. For example, different decimal separators are properly recognized depending on the locale setting of Windows system, as are different thousand separators.
If expression lies outside the acceptable range for Byte type, then an error occurs.
See also:
VBScriptSelect and copy to clipboard

Dim n
n = CByte(125.5678)   ' Returns 126
PROMOTIC 9.0.25 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.