Du bist hier: Snippet-Verzeichnis » Visual Basic (78)
Sprache:

Change Hex to String

Sprache: English
Programmiersprache: Visual Basic
Veröffentlicht von: slate2001 [nicht registriert]
Letzte Änderung: 15.05.2006
Aufrufe: 1536


Beschreibung

This function takes a given list of hexidecimal numbers (in groups of 2 hex numbers) and changes them into their corresponding base10 number. Then that number is changed into its corresponding ascii character.Good numbers:01462846ab3d020b03020a0cc0274636bad numbers (not in groups of 2):aadda88ad

Code

1 Function changetoasc(strtochange$) 2 Dim nextchra As String, inptxt$, lenth%, numspc%, newsent$, nextchr$ 3 Let inptxt$ = strtochange$ 4 Let lenth% = Len(inptxt$) 5 Let numspc% = numspc% + 1 6 Do While numspc% <= lenth% - 1 7 Let nextchr$ = Mid$(inptxt$, numspc%, 2) 8 Let numspc% = numspc% + 2 9 nextchra = "&H" & nextchr$ 10 nextchra = Chr$(CInt(nextchra)) 11 12 Let newsent$ = newsent$ + (nextchra) 13 Loop 14 changetoasc = newsent$ 15 16 End Function

Noch kein Kommentar vorhanden

Dieses Snippet kommentieren

Name *  

E-Mail (wird nicht angezeigt) *    

Website  

Kommentar *  

Sicherheitscode Sicherheitscode *    

RSS