To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Apr 22nd, 2007, 11:33 PM   #1
BefunMunkToloGen
Lively Member
 
Join Date: Feb 05
Posts: 107
BefunMunkToloGen is an unknown quantity at this point (<10)
Resolved [RESOLVED] Arghh...

Please download this project. It's only a few lines but it's giving me a headache.

Instead of going "12 34 56" it's going "12 23 34". Please help, and thanks.
Attached Files
File Type: zip InpChr.zip (1.3 KB, 6 views)
BefunMunkToloGen is offline   Reply With Quote
Old Apr 23rd, 2007, 12:01 AM   #2
iPrank
PoorPoster
 
iPrank's Avatar
 
Join Date: Oct 05
Location: in an island
Posts: 2,654
iPrank is a glorious beacon of light (400+)iPrank is a glorious beacon of light (400+)iPrank is a glorious beacon of light (400+)iPrank is a glorious beacon of light (400+)iPrank is a glorious beacon of light (400+)
Re: Arghh...

Problems:
1. You don't have Option Explicit
2. You need to increase the loop counter by 2
3. Don't use + for concatening strings. Use the & operator.
4. What is your goal ? Do you want to find ASCII values of individual digits ?
5. Please give meaningful thread title. Thanks.

vb Code:
  1. Option Explicit
  2. Private Sub Command1_Click()
  3.     Dim ToConvert As String
  4.     ToConvert = Text1.Text
  5.     Text2.Text = String_Chr$(ToConvert)
  6. End Sub
  7. Function String_Chr$(ByVal inString$)
  8.     Dim lenString As Long
  9.     Dim tmpString As String
  10.     For lenString = 1 To Len(inString) Step 2
  11.         tmpString = tmpString & "Chr$(""&H" & CStr(Mid$(inString, lenString, 2)) & """) & "
  12.     Next
  13.     String_Chr = Left$(tmpString, Len(tmpString) - 3)
  14. End Function
iPrank is offline   Reply With Quote
Old Apr 23rd, 2007, 12:06 AM   #3
dclamp
Terrible Member
 
dclamp's Avatar
 
Join Date: Aug 06
Location: United States
Posts: 2,822
dclamp has a spectacular aura about (150+)dclamp has a spectacular aura about (150+)
Re: Arghh...

6. Most people wont download code, you should post it with the syntax highlighting
dclamp is offline   Reply With Quote
Old Apr 23rd, 2007, 12:16 AM   #4
BefunMunkToloGen
Lively Member
 
Join Date: Feb 05
Posts: 107
BefunMunkToloGen is an unknown quantity at this point (<10)
Re: Arghh...

Thanks. That worked.

I apologise for the failure of a thread... Very late and tired. Solved, thanks again
BefunMunkToloGen is offline   Reply With Quote
Old Apr 23rd, 2007, 12:18 AM   #5
dclamp
Terrible Member
 
dclamp's Avatar
 
Join Date: Aug 06
Location: United States
Posts: 2,822
dclamp has a spectacular aura about (150+)dclamp has a spectacular aura about (150+)
Re: [RESOLVED] Arghh...

hey no problem. and thanks for the rep
dclamp is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:48 PM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.