Conversion Functions¶
- Asc
- Base64DecodeText
- Base64EncodeBinary
- Base64EncodeFile
- Base64EncodeText
- CBool
- CByte
- CCur
- CDate
- CDbl
- Chr
- ChrW
- CInt
- CLng
- CSng
- CStr
- Hex
- IsNumeric
- Oct
Asc¶
Returns the NUMBER code that represents the specific character.
Syntax
Arguments
- string
- The specified character to retrieve the NUMBER code for. If more than one character is entered, the function will return the value for the first character and ignore all of the characters after the first.
Base64DecodeText¶
Decocdes a textual value encoded in Base64 form.
This function is often used in webservice type integrations, where a Base64 encoded value is returned from a service.
Syntax
Arguments
- value
- The Base64 encoded value.
Base64EncodeBinary¶
Base64 encode a binary value such as an image (png, jpg, gif) or document (pdf).
This function is often used in webservice type integrations, where a Base64 encoded value is required to post to a service.
This function should often be used with the WebserviceGetBinary Function function to encode the result to a usable format.
Syntax
Arguments
- value
- The binary value.
Base64EncodeFile¶
Base64 encodes the contents of a file.
This function is often used in webservice type integrations, where a Base64 encoded value is required to post to a service.
This function can be used to upload images to a webservice, assuming it requires a Base64 encoded representation of the image (such as the Shopify Product Image upload).
Syntax
Arguments
-
file
- The path to the file.
-
throwonerror
- Optional. When set to False the function will return an empty string instead of raising an error when an error occurs either opening or reading the file.
Example
' IMan-specific. Reads a file and returns its Base64
' encoding. The second argument is throwOnError: leave
' it False and an unreadable file yields an empty
' string, so the integration continues.
Base64EncodeFile("C:\IMan\Outbound\SO-10432.pdf", False)
' A FileSystem setup can be named FIRST, in which case
' the path is resolved through it -- Azure Blob, OneDrive
' or S3 -- rather than against the IMan server's own
' filesystem. The container comes from the setup.
Base64EncodeFile("AzureBlob-Archive", "outbound/SO-10432.pdf", True)
Base64EncodeText¶
Base64 encodes a textual value.
This function is often used in webservice type integrations, where a Base64 encoded value is required to post to a service.
Syntax
Arguments
- value
- The textual value.
CBool¶
Converts a value to a boolean.
Syntax
Arguments
- expression
- Any valid expression. If expression is zero, False is returned; otherwise, True is returned. If expression can't be interpreted as a numeric value, a run-time error occurs.
CByte¶
converts a value to a byte. (ie: number between 0 and 255).
Use the CByte function to provide conversions from any data type to a Byte subtype. For example, CByte forces byte arithmetic when currency, single-precision, double-precision, or integer arithmetic would normally occur.
The CByte function uses the locale setting of your system to determine how to perform conversions. Different decimal separators are properly recognized depending on the locale setting, as are different thousand separators.
Syntax
Arguments
- expression
- Any valid expression. If expression lies outside the acceptable range for the byte subtype, an error occurs.
CCur¶
Use the CCur function to provide conversions from any data type to a Currency subtype. For example, CCur forces currency arithmetic when integer arithmetic would normally occur.
The CCur function uses the locale setting of your system to determine how to perform conversions. Different decimal separators are properly recognized, depending on the locale setting, as are different thousand separators.
Description
Returns an expression that has been converted to a Variant of subtype Currency.
Syntax
Arguments
- expression
- Any valid expression.
CDate¶
Use the IsDate function to determine if date can be converted to a date or time. CDate recognizes date literals and time literals as well as some numbers that fall within the range of acceptable dates. When converting a number to a date, the whole number portion is converted to a date. Any fractional part of the number is converted to a time of day, starting at midnight.
CDate recognizes date formats according to the locale setting of your system. The correct order of day, month, and year may not be determined if it is provided in a format other than one of the recognized date settings. In addition, a long date format is not recognized if it also contains the day-of-the-week string.
Description
Returns an expression that has been converted to a Variant of subtype Date.
Syntax
Arguments
- date
- Any valid date expression.
CDbl¶
Use the CDbl function to provide conversions from any data type to a Double subtype. For example, CDbl forces double-precision arithmetic when currency or integer arithmetic would normally occur.
The CDbl function uses the locale setting of your system to determine how to perform conversions. Different decimal separators are properly recognized depending on the locale setting, as are different thousand separators.
Description
Returns an expression that has been converted to a Variant of subtype Double.
Syntax
Arguments
- expression
- Any valid expression.
Chr¶
Description
Returns the character based on the number code.
Syntax
Arguments
- number_code
- The NUMBER used to retrieve the character.
ChrW¶
Description
Returns the unicode character based on the number code.
Some Unicode characters can be difficult represent, enter or are non-visible. This function allows you to represent (or return) any Unicode character through its decimal value.
Syntax
Arguments
- number_code
- The Unicode decimal NUMBER used to retrieve the character.
CInt¶
Use the CInt function to provide conversions from any other data type to an Integer subtype. For example, CInt forces integer arithmetic when currency, single-precision, or double-precision arithmetic would normally occur.
The CInt function uses the locale setting of your system to determine how to perform conversions. Different decimal separators are properly recognized depending on the locale setting, as are different thousand separators.
If expression lies outside the acceptable range for the Integer subtype, an error occurs.
Description
Returns an expression that has been converted to a Variant of subtype Integer.
Syntax
Arguments
- expression
- Any valid expression.
CLng¶
Use the CLng function to provide conversions from any data type to a Long subtype. For example, CLng forces integer arithmetic when currency, single-precision, or double-precision arithmetic would normally occur.
The CLng function uses the locale setting of your system to determine how to perform conversions. Different decimal separators are properly recognized depending on the locale setting, as are different thousand separators.
If expression lies outside the acceptable range for the Long subtype, an error occurs.
Description
Returns an expression that has been converted to a Variant of subtype Long.
Syntax
Arguments
- expression
- Any valid expression.
CSng¶
Use the CSng function to provide conversions from any data type to a Single subtype. For example, CSng forces single-precision arithmetic when currency or integer arithmetic would normally occur.
The CSng function uses the locale setting of your system to determine how to perform conversions. Different decimal separators are properly recognized depending on the locale setting, as are different thousand separators.
If expression lies outside the acceptable range for the Single subtype, an error occurs.
Description
Returns an expression that has been converted to a Variant of subtype Single.
Syntax
Arguments
- expression
- Any valid expression.
CStr¶
Use the CStr function to provide conversions from any data type to a String subtype. CStr forces the results to be expressed as a String.
The CStr function uses the locale setting of your system to determine how to perform conversions. Different decimal separators are properly recognized, depending on the locale setting.
The data in expression determines what is returned according to the following expressions:
Description
Returns an expression that has been converted to a Variant of subtype String.
- Boolean
- A String containing True or False.
- Date
- A String containing a date in the short-date format of your system.
- Null
- A run-time error.
- Empty
- A zero-length String ("").
- Error
- A String containing the word Error followed by the error number.
- Other numeric
- A String containing the number.
Syntax
Arguments
- expression
- Any valid expression.
Hex¶
Description
Returns a string representing the hexadecimal value of a number.
Syntax
Arguments
- number
- Any valid expression. If number is not a whole number, it is rounded to the nearest whole number before the number is evaluated.
IsNumeric¶
Description
Returns a Boolean value indicating whether an expression can be evaluated as a number.
Syntax
Arguments
- expression
- Any valid expression.
Oct¶
Description
Returns a string representing the octal value of a number.
Syntax
Arguments
- number
- Any valid expression. If number is not already a whole number, it is rounded to the nearest whole number before being evaluated.