|
-
Jul 20th, 2006, 05:19 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Chr$
Hello everyone,
I was just going through this book I had about Internet Programming using Visual Basic 6.0.
I came across this code:
VB Code:
dq = Chr$(34)
sq = Chr$(39)
dq and sq are variables
The problem is that I don't understand what Chr$ does and I cannot find an explanation of it in the book. I looked up in the Object Browser of Visual Basic 6.0 and I get the following definiton:
Chr$: Returns a string containing the character associated with the specific character code
Format: Chr$(CharCode As Long)
Now I understand that it returns a string containing the character associated... But all I am attaching are the digits 34 and 39. By these digits seem to be some sort of Character Codes... Could someone please explain what Character Codes are and what these two mean.
Note: If someone can provide me with a list of all character codes and their explanations, I would really appreciated it.
Thank you all in advance.
Khanjan
Hey... If you found this post helpful please rate it.

-
Jul 20th, 2006, 05:22 PM
#2
-
Jul 20th, 2006, 05:24 PM
#3
Re: Chr$
The Long values represent the Ascii codes.
Try this in a new project:
VB Code:
'Place a ListBox on a Form.
'Will display All ASCII Characters
Option Explicit
Private Sub Form_Load()
Dim intIdx As Integer
For intIdx = 0 To 255
List1.AddItem "Decimal: " & intIdx & " = Char: " & Chr$(intIdx)
Next
End Sub
-
Jul 20th, 2006, 05:24 PM
#4
Re: Chr$
The character codes are the ASCII values of the characters. 34 is the double-quote (") and 39 is the single-quote('). You can find a chart of them here. (Use the Dec values [the first column].)
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jul 20th, 2006, 05:32 PM
#5
Thread Starter
Hyperactive Member
Re: Chr$
Oh thanx a lot guys...
Basically what my program is trying to do is get the html tags. And since the location in the tags can be in double quoted (") or single quoted ('), the variables are being assigned the ASCII value of these... basically trying to find the link part of the html tag. Thanx a lot guys, I appreciate your help.
Khanjan
Hey... If you found this post helpful please rate it.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|