Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Convert ASCII Code To Character


I am able to get the ASCII code for a character by using the Asc function, but how do I go about getting the character for that ASCII code? If there a command that is pretty much the opposite of Asc? -Matt.<('.')>"Unthinking respect for authority is the greatest enemy of the Truth."




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Convert Character To Ascii Code?
hi,

Is there anybody help me on this.
How can i convert Character A or B or C and other, to ASCII code

Thank you very much
Regards
Ooi

Ascii Code For Character
Hi All,

I have a listbox displaying all character. When i click on 1 of therecord from the listbox, eg. "a" it will give me the ascci 97. But iencounter problem whereby it will give me ascii as "0" for everycharacter. Can anybody help me? Below is my code

Private Sub List1_Click()
Dim keyascii As Integer

Text1 = List1
Text2 = keyascii

End Sub

I'll not encounter this problem if i assign a value into text1, it willgive me the correct ascii.



Private Sub text1_KeyPress(keyascii As Integer)
Text2 = keyascii
End Sub

Thanks.

Rgds,
Khai Sze

Inserting ASCII Character By Code
Hi guys and girls,
At this point I feel quite stupid for putting this on the forum, but I simply can't find a solution.

What I want, is to enter non-alphabet ASCII characters in a cell by code. For example "√" (Alt+251) (which is what I specifically need in this case) can be entered using the keyboard. But when I use the macro recorder on this I get "v" in my code and also in the cell. Another thing I tried was changing the font to something like "Symbol". That indeed changes the "v" to a symbol, so there possibly is a character in that font like "√". But that means that the rest of the cell is also in that font.

Edit: OK, just found out that you can use several fonts in one cell.

In short, how do I enter "√" in a cell without changing the font?

Thanks for any help.

2nd Edit: Why isn't "√" in ASCII according to VBA help?

How To Display Ascii Character Over Code No.128 ?
My platform is VB6 on windows 98 ( chinese version )
I would like to display in a VB form the ascii character over code no. 128, such as chr(136), chr(137), etc.
I cannot display the correct character by using the chr function.
Does anyone know how to do ?

How To Convert Ascii To Hex Code?
How to convert Hex code to ASCII code and convert
ASCII code to HEX code by VB code?
how to analyse the hex code bit by bit?

Convert Hex To ASCII, Code Is Attached
Arnout, I don't see CLng() returns a Decimal value from Hex. I tried as follows but a mismatch error happens. It only takes values 0 to 9

Option Explicit

Dim SMSOctetOutput

Dim StrHextoDecimal, StrDecimalToAscii

Dim strText


Private Sub Command1_Click()


SMSOutput = Text1.Text


StrHextoDecimal = CLng(SMSOctetOutput)

StrDecimalToAscii = Str(StrHextoDecimal)

Text2.Text = StrDecimalToAscii


End Sub


My intention is to convert a Hex value to ASCII

Convert Char To ASCII Code
Helo! Any idea ya? Or i should convert one by one?

How To Convert Binary Code To Ascii Code
Does anyone know how to convert binary file to text file

Comport Read Code(how I Wil Convert Ascii To Decimal)
Respected Sir

I am facing problem to read data from comport I have used MSCOMM but i am getting data in ASCII code But i want it in decimal format How i will get it ?

Your help (sample code) and guidance is greately appreciated!

Regards

Bama

Convert Ascii Constant To Ascii Value With Program
How would I go about doin the following? If a string contains "vbKeyF1", how would i get vbKeyF1's ASCII value equivalent (ie: 112) to be written in another string?



Edited by - Marce22 on 10/10/2003 7:04:38 PM

ASCII Character
I need to include this character "Σ" in my data report. When I type ALT+228 in a text file, it returns Σ. But when I tried to type it in a VB form or label, it returns the character "S". Then I tried to call the character by typing tis code


Code:
label.caption = CHR(228)
it returbs the character "ä"!!

Im wondering whether there is any setting I need to change. or is there any idea where I can include the character "Σ" in my vb project.

Character To ASCII
Can someone please give me some code to convert characters to ascii in vb

Ascii To Character?
I have a string of html ascii codes pulled from a web page using an inet control. An example would be..

Dim Str As String
Str = Inet1.OpenURL("http://www.example.com")

Which would make a string like this..

Str = "&#104;&#105;" (replace & with & as i cannot because the browser will recognise the code and it will output the actual letter)

I then need to convert these to characters.. so the above example would output 'hi'. I have tried using Chr(Str) but this does not work. Any ideas?

ASCII Character
old dos program use ASCII character to draw line or table,

but when i open it as txt file in vb, it won't show the line, how to see the line or table in vb, is it font name problem?

Character To Ascii
does anyone know how to take a letter in a string and find its ascii code? I only know how to take an ascii code and get the character.

ASCII Character
Hi,does anybody know what is an ascii character fro formfeed
Thanx

Character To Ascii
How do I change an individual character to it's Ascii value?

I am looping through the length of a string and getting each character and want to know the Ascii value for each character.

How Do You Figure Out What ASCII Character Something Is?
I have a file that I'm sending through a serial port. I can't modify the file at all. In the file there are several square boxes. I've learned that these are characters such as vbLF or vbCR and such. One of them, the very last one in the file, I've yet to find out what it is.

I've attached the file, could someone either tell me how to find out, or tell me what character it is.... preferrably both. =)

Find The Ascii Character
Does anybody knows the opposite of the Asc() function?
(Give an integer and take the character)

Print ASCII Instead Of Character
Hi,
Let's say sString="aAbBcC", how would I print that string on a msgbox in ASCII?

Thanks,

PhiL

Ascii Character Codes In VB
Related to my previous post, I am trying to write a program that creates html files. How can I get VB to write a quotation mark when it is part of a line such as:

<SCRIPT language="JavaScript">

in the VB code, it looks something like:

PRINT #1, "<SCRIPT language=" + ?? + "Javascript" + ?? + ">"

but I'm not sure how to code the ?? to print a quotation mark in the final external html file.

Thanks.

Ascii Character For Euro
Hey all, can anyone tell me if there is an ascii character for the Euro sign ?? I've googled the net for the ascii character set and searched this forum and can't find anything...... thanks !

Print ASCII Instead Of Character
Hi,
Let's say sString="aAbBcC", how would I print that string on a msgbox in ASCII?

Thanks,

PhiL

Search For A Particular Ascii Character
I what to search a piece of text for a particular ascii character, I have tried
Code:
If InStr(0, strFile, Chr$(10)) Then ......
'And
If InStr(0, strFile, Asc(10)) Then ......
'And
If InStr(0, strFile, Asc("10")) Then ......
Ascii Code 10 - Line Feed, the character I'm looking for, but it doesn't work. Any suggestions

ASCII Character For Bold
Hi,

Can anyone tell me what is the Character code to make a text bold.

Thanks in advance
Radhika

Insert Ascii Character Codes
Most people want to remove ascii codes for special characters but I want to replace the special characters in a Word document with their ascii codes. Is there any automated way to do this? Or do I have to search for the characters and replace with their ascii coade text string?

Converting Ascii Character To Integer
Hi all...

I am recieving ascii characters from the coms port and i would like to be able to convert them to a interger value.

How would i go about achieving this??

Thanks heaps,
Someone

Print Ascii Character On The Screen
Here is another similar question. How would you get it to print the character of an ascii code? Meaning something like Asc(65) would print "A" on screen?



Never mind i got it....

(SOLVED) Ascii Of Control-Z Character Help?
I need to write to a text file the control-Z caracter.
Is any ascii code for that?

Actualy I need to send it to the comm port using mscomm control.
I have connect my mobile phone on comm port and I use mscomm control to send some AT commands that send an SMS.
The last command that I need to send is the control-z.

thks in advance


elias

Numeric,ascii, Character -separation
hi all
hi have a 200 field width of word which contains numeric,charaters,ascii codes, again numeric,charater, i need to separate the above line and to store in a separater above siad fileds as numeriic,ascii,charcter,nueric,character, that too the word is not same length , replies will be helpful..
cheers
parthi

Character Codes(ansi Or Ascii)
I can't figure out the stupid command for extracting the character code for a character...

is it Chr()?

Ascii Character & Tabstrip Control
Does anyone have a tabstrip example to show how to build a tab control in a step-by-step example?
I'm stuffed if i can get these to work.

Also does anyone know why when i put in the ascii character 153 (trademark symbol) all i get is a thick vertical line? as a matter of fact none of the characters between 150 to 159 work.
I can get the copyright symbol (169) and the registered symbol (174) to work ok but not the trademark one.
I'm using them all like this Chr(169)

Can anyone help?

Ascii Character Set Functions In Text Boxes
Help!!

I am trying to edit some text in a text box by using the ascii codes for the editing functions i.e. chr(8) for delete etc, at the moment when i write the following:

textbox.text = textbox.text & chr(8)

instead of deleting the last character a black rectangle appears, which i guess means the the command is being written as its character rather than its function.

How can i get over this problem??

ps i also want to use the controls for tab, shift, shift lock and the other general keyboard function keys.

Removing A Single Ascii Character On A Form
If I use the following code on a form with Courier New or Terminal as it's font, and the form's scalemode set to Character, the second character does not replace the first one, which makes sense. But I want it to. So is there some way of clearing just that 10,10 coor of whatever's there without having to use BitBlt? Or must I use BitBlt? And I can't use Me.Cls

Me.CurrentX = 10
Me.CurrentY = 10
Me.Print "A"
Me.CurrentX = 10
Me.CurrentY = 10
Me.Print " "

How To Make A Text Box Display Ascii Character
i have a text box that receives the ascii character's sent by a server but it only receives the first ascii character and the others are not displayed ..how to make it display the total ascii character sent by the server ???

Limiting The Number Of A Particular Ascii Character In A Text Box?
Hello,

Can anyone tell me how I can limit the number of times that an Ascii character can occur in a text box?

Thanks, Bruce

Manipulating Individual Character's ASCII Values
I was wondering if there's a command to manipulate the ascii value of specific characters in visual basic. It's a fairly simple process in other more complex languages.

The problem that I have is that I am making a curriculum for a summer camp teaching grade 6-8 students the basics of programming. The project I wanted to do was to write a simple encode/decode program in visual basic that the kids could create a windowed exe file they could execute at home but the best way I know how to encode a basic text message is to manipulate the ascii value. If there's any more project ideas out there or another way to encode that would be welcome as well as letting me know if there is a way to maniuplate character ascii values.

Convert .wav To ASCII
Hi,
I would like to convert a file in wav format into txt format, so to obtain a vector of numbers to create a graphic, with a program, like excel, that is not Matlab.
Exactly I've an algorithm in Visual Basic that analyses a vector of points (graphic) and then gives me in output a series of parameters.
In matlab this is easy, because it recognizes wav files but if I would like to do the same thing in Ms Access, I've to convert before, the wav file in txt file so that my algorithm in Visual Basic can analyse it.
Anyone knows if there exist some algorithm or code that convert wav files in ASCII text files?
Thanks
Bernd

Convert Ascii To Hex
ok i know to convert hex to ascii is simply Val("&h" & hexvalue), but how do you convert ascii to hex? using somthing simple like that (if existant), maybe i just need sleep to realize how to do it but right now i cant think of how to do it. help!!!

Convert *.Wav To ASCII
Is there a way to convert a *.wav file to a ASCII text that contains the sound in a numerical way. I also want to know the otherway around (converting ASCII to *.wav)
I f there's anybody who has a idee please let me know

Thanks

Christian

Convert CSV To ASCII
I am trying to take a CSV file and convert it to ASCII. Any suggestions?

How To Store && Read The Display Pattern For Each ASCII Character??
Hi out there...
I have something to ask about my programming stuff. Currently i am using visual basic 6.0 to do my programming.

What i want is like that:

Base on an ASCII character, my program will able to find the pattern that represent the character and display it on the dot matrix array.

How am i going to store all the patterns for each of the ASCII character?
Eg. for the character 'A', the equivalent display pattern is [c1,b7,77,b7,c1].
*Note: all display pattern is in hex.

How am i going to retreive the pattern for each ASCII character?
Eg. for the character 'A', the display pattern [c1,b7,77,b7,c1] will be send out to the dot matrix array.

Thanks!!

How To Convert Upper Case Character To Lower Case Character?
Hi ,
I would like to know how to convert upper case character to lower case character. Because i am doing simple search engine. It has case sensitive.
For example, there has a keyword "Automation" in my databse, but if i type automation ,it could not be searched. just only can type Automation.
How can it automatically convert "A" to "a" then the rest of character remain the same?so that when i type automation ,it will be detected .Does anyone can help me? Can use If..Else method?



Regards,
xin xin

How To Convert Raw Binary Into Ascii Hex
i need to know how to convert raw binary into ascii hex, i searched around but couldnt find anything on it. anyone know?

Convert Char To ASCII
I was wondering if there was a way to check that the first character in a string is a letter vs. a number.
Example: "123M" vs. "M123"
I was thinking of taking the first charcter, changing it to its ASCII value and comparing it with ASCII value of letters vs. numbers to figure it out that way..
Is there some feature in VB 6.0 that i can use to see whether the character is a letter or number? (Zero is included in the numbers.)

Thanks!!

Convert 5 Lines Of Hex To ASCII
OK, I have been reading up on ASCII but still can not get this right.
My app reads from a device on com port that sends 5 lines of ASCII code
Example

Quote:




49 02 01 00 00 00 31
49 02 02 47 36 4B 44
49 02 03 35 34 59 58
49 02 04 32 55 31 33
49 02 05 34 38 33 32

>





Which I need decoded to

Quote:




1g6kd54yx2u134832






The documentation I have found says this

Quote:




Returns 5 lines, A is line ordering flag, B-E ASCII coded VIN Digits





So I guess the 49 02 of each line is to be ignored?
and the rest needs to be converted?

Below is a screen shot of the message I received today

Convert A Word To Ascii
Hi peeps i was wondering if anyone can help me with this problem.

i am making a program to convert words to ascii and then display the ascii in a textbox

i can make it convert 1 letter of the word only. is there anyway to make it convert the whole word into ascii

thx

Convert Characters To Ascii No.
i have an array called chars(). when my program runs, 1 character is stored in each variable of the array eg. chars (0) stores 1 character, chars(1) stores 1 character and so on. i heard that there are 256 ascii characters, is there a simple and fast way to convert each character into its ascii number, say chars(0) had the letter u stored in it and the number of u was 132 then chars(0) would be changed to 132
thanks

How To Convert It To ASCII File
I download a log file from SUN server,if i open it with notpad,it looks like: ???? % @#w./.....; it's a binary file , my custumer can't read it unless it is a ASCII file.so i want to know how to convert it to ASCII file readable with .TXT or .XLS


maybe I should use following :
open "d:log001" For Binary As 1
...
...
Get .....
...
Close 1
Open "d:
esult.txt" For Random As 1
.....
Put ...

but it's difficult to know the rule of binary file,
any advice is very useful to me!thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved