Advertisement

06.23.2004 at 10:03AM PDT, ID: 21035652
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Converting an ASCII string, and adding a space between the Hex output for easy readability:  "String Expert" needed!

Zone: VB Controls
Tags: asciitohex, ascii
Hi Folks,

I have a "problem" that I just don't have the time to sit down and figure out.  I've written 95% of the code that I need to, but I'm hung up on a "simple" (that's a laugh!) problem that is just eluding me (I KNOW I am not a "string expert")..

PROGRAM CONTROLS:  1 Form, 2 Textboxes, and 1 Command Button
Textbox1 is for the string input, Textbox2 is strictly for the Hex output conversion, the Command Button initiates the event.


Below is the code associated with the program, first the code in the form:
'*****************************************************
Private Sub Command1_Click()
Dim HexData As String
Dim sText As String

 ' Get ASCII String From Text1
 sText = Text1.Text
   
' Convert Some Text From ASCII To Hex
 If Len(Text1.Text) > 0 Then
     HexData = AsciiToHex(sText)
 End If
       
 ' Display The Hex Output
 Text2.Text = HexData

End Sub
'*****************************************************

Next:  the function code in a module that performs the ASCII to Hex conversion
'*****************************************************

Dim lTextLength As Long
'**************************************************
' Function To Convert ASCII To Hex Code
'**************************************************
Public Function AsciiToHex(sText As String) As String

For lTextLength = 1 To Len(sText)
AsciiToHex = AsciiToHex & Hex$(Asc(Mid(sText, lTextLength, 1)))
On Error Resume Next
DoEvents

Next lTextLength

AsciiToHex = Mid$(AsciiToHex, 1, Len(AsciiToHex))

End Function
'**************************************************

All of the above code works perfectly in converting an ASCII string to hex, here is the challenge,
below is an example of what I want to do (the current output is shown first):

Input String:        Servoguy
Hexoutput:           536572766F677579

I would like help with my code so the results will look like this:

Input String:        Servoguy
Hexoutput:           53 65 72 76 6F 67 75 79

I would genuinely appreciate any ideas, strategies, or actual code modification to achieve these results.

I want to say thanks in advance to anyone (or everyone) who takes a shot at this.

Best to all,

servodude






Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: servodude
Solution Provided By: vinnyd79
Participating Experts: 2
Solution Grade: A
Views: 4
Translate:
Loading Advertisement...
06.23.2004 at 12:18PM PDT, ID: 11382524

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.23.2004 at 02:34PM PDT, ID: 11383686

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
09.09.2004 at 07:26AM PDT, ID: 12016890

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29