ASCII Conversion

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

Anyone know an easy way to convert a Decimal Number to
ascii. As an example 12592 decimal = 10 ascii. Please
reply asap.
 
In what sense is 12592 decimal = 10 ascii? Are you saying the decimal number
12,592 is equivalent to the ASCII string "10"?
 
Bob, Thanks for the reply. What I have is a decimal number 12592 and it
is being converted to an ascii string "10",and vice versa. I need a
quick way to check the data transmission and conversions of these
numbers. I set up dde link to capture the data from a remote computer ,
but the data is converted to decimal numbers as soon as it hit the
interface. I know what the ascii string should be but I would like to
captire it real time.

thx
Keith
 
Are you saying that you know the rule that governs the conversion, but you
just want to do the comparison faster?
 
Sorry, I don't know the rule either. It could be a DDE standard of some
kind, but I am not familiar with DDE enough to know. The only other
suggestion I can offer is to send something you know and see how it is
converted and either infer the rule or make up a conversion table, if
feasable.
 
Keith

The numbers one to 9 use the codes 49 to 57 do you want to
add the code up?

The following will print the ascii code for each number in
the columns to the right. So in your example you will need
5 blank columns to the right of the number.

Sub Test2()
Dim c, a
Dim l As Integer, s As Integer
For Each c In Selection
l = Len(c)
For s = 1 To l
a = Asc(Mid(c, s, 1))
c.Offset(0, s) = a
Next s

Next c
End Sub

Regards
Peter
 
Hi Keith,
If your data is being transmitted as ASCII (aka: ascii text) then you would
receive 6 characters.
49 50 53 57 50 10 or 13. 10 is the linefeed char. 13 is the carrage return
char.

If the data is being transmitted in binary then you would receive the
hexadecimal equilivents.
31 32 35 39 10 A or D
Or a hex value of 3130. It depends on the bits per byte. 8 bit, 16 bit 32
bit....

In any case you are receiving a string or series of byte values. It's either
an ASCII byte or HEX byte.

No idea why or how your seeing 10.

There are worksheet functions hextodec(), dectohex(), dectobin() if your
running the analysis toolpak add-in.

Get specific. What programs and what protocols are you using?
Lan? Internet?

Using code? Post it.


--
John
johnf 202 at hotmail dot com


| Anyone know an easy way to convert a Decimal Number to
| ascii. As an example 12592 decimal = 10 ascii. Please
| reply asap.
 
Back
Top