Asc()

Syntax

Asc(a$)

Remarks

Returns the character code of the first character in a$. Although "Asc" is short for ASCII, Asc() actually returns ANSI codes. The function name is preserved for compatibility purposes. You can use the syntax Asc(Selection$()) to return the code for the character to the right of the insertion point (for example, to test for a paragraph mark).

Example

This example moves to the beginning of the next paragraph and checks the character to the right of the insertion point. If the character is a paragraph mark, indicating an empty paragraph, a message box is displayed.


ParaDown
If Asc(Selection$()) = 13 Then
    ans = MsgBox("Empty paragraph. Continue?", 4)
End If

See Also

Chr$(), Len()