Method
AscB
Warning
This item was deprecated in version 2019r2. Please use String.AscByte as a replacement.
Usage
result=AscB(string)
OR
Introduced 5.0result=stringVariable.AscB
Part |
Type |
Description |
---|---|---|
result |
The value of the first character of string. |
|
string |
Any valid string expression. |
|
StringVariable |
Any variable of type String. |
Notes
The AscB function returns the code for the first byte in the String passed. If you need to get the character code of the first character of the string rather than the first byte, use the Asc function.
AscB should be used instead of Asc when the string represents binary data or when your application will run on a one-byte character set (such as the US system) and you want case-sensitivity.
Sample code
This example uses the AscB to get the value of the first byte of the string passed.
MsgBox Str(AscB("a")) ' returns 97
MsgBox Str(AscB("A")) ' returns 65
Compatibility
All project types on all supported operating systems.
See also
Asc, String.ChrByte, String.IndexOfBytes, String.LeftBytes, String.Bytes, String.MiddleBytes, String.RightBytes functions.