Jump to content
Fivewin Brasil

Retirar caracteres Hexadecimal da string


Edu

Recommended Posts

Bom dia!

Alguém sabe como posso testar se há caracteres hexadecimal numa string?

Tentei com a função IsXDigit(), mas retorna erro: Unrecoverable error 9023: hb_xgrab requested to allocate zero bytes.

Grato.

Link to comment
Share on other sites

Edu

Boa tarde

Function Testa_String(pString)

cLetras := "ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxz0123456789"

For x:=1 To Len(pString)

        If !(SubStr(pString,x,1) $ cLetras)

            Return .F.

         Endif

Next

Return .T.

Att

João Bosco

Link to comment
Share on other sites

João.

Acho que não funcionaria pois não tenho como saber qual o tamanho do hexadecimal e nessa função está testando bit a bit.

Ex: 

Caracter: Ç  em hexadecimal é : xC7.

Caracter: º   em hexadecimal é: xBA. 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...