AscB Function

Returns as an Integer, the value for the first byte of a String.

Syntax
result = AscB( string )
result = stringVariable.AscB( )

Parameters
string | String | Any valid String expression.

Return Value
Result | Integer | The value of the first character of 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.

# Examples

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

# See Also

Asc, ChrB, InStrB, LeftB, LenB, MidB, RightB functions.