hi... anybody know the source code vb6.0 to convert asii to hex? thanks
convert ascii to hex form
Collapse
X
-
Tags: None
-
Hi Maharajakecil,Originally posted by maharajakecilhi... anybody know the source code vb6.0 to convert asii to hex? thanks
create a new project add a new module and call it
ModHexASCII
also add 2 textboxes call them
txtAscii and txtHex
on the module add this..
Code (vb 6)
on your form add a command button and add this...Code:Option Explicit Public Function HexIt(sText As String) As String Dim A As Long For A = 1 To Len(sText) HexIt = HexIt & Hex$(Asc(Mid(sText, A, 1))) & Space$(1) On Error Resume Next DoEvents Next A HexIt = Mid$(HexIt, 1, Len(HexIt) - 1) End Function
hope this helps you. If you need the code to convert from hex to ascii let me know and i will post for you.Code:If Len(txtAscii.Text) > 0 Then txtHex.Text = HexIt(txtAscii.Text) End If
GobbleGob.Comment
-
hi veena,
i need to convert from ascii to hex because i need my GUi send an integer to my PIC circuit in hex form. the output from computer(GUI) is in ascii right? so i need the output from GUI in hex form so that i can send it directly to the PIC circuit. but i really dont know whether during tansmision of the output is in ascii or hex after convert it to hex form. i'm newest in GUI(VB). i had lost.....Comment
-
hi gobbleGob
you make my day bright again
i want convert only integer to hex form.
the range of integer will be 0 to 15 only.
one more thing if i want send the output from vb to the hardware, the signal will be in hex form if i'm convert it into hex right?
correct me if i'm wrong... thanks again.Comment
-
Comment
Comment