Conversion Functions
Built-in conversion Functions

Method PrototypeDescription
Asc( char As String ) As Integerreturn the Unicode code point of the first character of a string
AscB( char As String ) As Integerreturn the byte value (0-255) of the first byte of a string
CDbl( valstr As String ) As Doubleconvert a text representation of a number (which may include thousands separators) to a number
Chr( ascii As Integer ) As Stringconvert an ASCII value (0-127) to the corresponding character
ChrB( b As Integer ) As Stringconvert an arbitrary byte (0-255) to a 1-byte string
CMY( cyan As Double, magenta As Double, yellow As Double ) As Colorconstruct a color from cyan, magenta, and yellow
CStr( value As Double ) As Stringconvert a number to a string, using the system's default decimal separator
Format( value As Double, formatSpec As String )format a number in a specified way
Hex( value As Integer ) As Stringconvert a number to its hexadecimal representation
HSV( hue As Double, saturation As Double, value As Double ) As Colorconstruct a color from hue, saturation, and value
Oct( value As Integer ) As Stringconvert a number to its octal representation
RGB( red As Double, green As Double, blue As Double ) As Colorconstruct a color from red, green, and blue
Str( value As Double ) As Stringconvert a number to a string, in a format understood by Val
Val( valstr As String ) As Doubleconvert a text representation of a number number (with "." for a decimal separator, and no thousands separators) to a string



These functions convert numbers to strings or colors, or vice versa, in various ways.