<< Prev        Next >>

ID : 275

Asc

Function

To return a character code of the first character in the designated string by integer type data.

Syntax

Asc(string)

Guaranteed entry

String
Designate string type data.

Return value

Return a character code by integer type data.

Description

A character code of the first character in the designated string is returned by integer type data.

Related Terms

Chr, SprintF, Left, Len, Mid, Right, Val, InStr, Bin

 

Attention

-

Example

'!TITLE "Conversion into Character Code"
' Assign "A" character code to aaa
Sub Sample_Asc

  Dim aaa As Integer

  ' Assign "A" character code 65(&H41) to aaa
  aaa = Asc( "A" )

  ' Display "A" character code (65) on the message output window
  PrintDbg aaa

  ' Assign "A" character code 65(&H41) to aaa
  aaa = Asc( "ABCDEFGH" )

  ' Display "A" character code (65) on the message output window
  PrintDbg aaa

End Sub

ID : 275

<< Prev        Next >>