Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unicode--->ASCII

Status
Not open for further replies.

Unknownpso

Programmer
May 9, 2005
3
0
0
US
hi im grabbing data from a address and i want to make the address value appear in ASCII instead of #'s how would i go about this?
 
What do you mean?
Like a URL address? or what? ...example?

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
no i mean like

006FB7B0=address
xxxxxx=value in Numbers eg:1,2,3,4,5etc
i want the value to appear in ASCII eg: a,b,c,a,e
the real value is in ASCII but shows up in #s
 
From the VB 6 help files:

The ChrW function returns a String containing the Unicode character except on platforms where Unicode is not supported, in which case, the behavior is identical to the Chr function.

Lee
 
Like this:
Code:
Dim hHex As String
Dim dDec As Long

hHex = "0000C4E0"
    dDec = CLng("&H" & hHex)

MsgBox dDec

David
 
Or are you trying to turn a 65 into an A, 66 into B, 67 into C etc ???

Except it is in hex so 41 is A, 42 is B and so on?
 
unknownpso
Please read faq222-2244 to get the best from the forum. Then if you haven't solved this yet then please post the actual input data and the expected output data, and then we can solve the problem instead of guessing in the dark

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
Essex Steam UK for steam enthusiasts
 
>006FB7B0=address
>xxxxxx=value in Numbers eg:1,2,3,4,5etc

We still don't get what you exactly mean... but it feels like you are talking about memory addresses.

To get the text string from a memory address, you can simply use the SysAllocString function. Which returns the text string from a memory location.
___
[tt]
Private Declare Function SysAllocString Lib "oleaut32" (pOlechar As Any) As String
...
Dim S As String, L As Long
L = &H6FB7B0 'make sure this is a valid address!
S = SysAllocString(ByVal L)
MsgBox S[/tt]
___

May be this is what you mean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top