Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


VB 2008 Express Help!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
EvilSparx
Expert Cheater
Reputation: 0

Joined: 29 Nov 2008
Posts: 175
Location: Behind You!

PostPosted: Mon Dec 01, 2008 2:25 am    Post subject: VB 2008 Express Help! Reply with quote

I'm working on a translator, all I need is a code.
Its got a box (called textbox1)
A button (called button1)

I want it so that when I type an "A" in the text box, and I click the button, it transforms the "A" into a "1"

eg, if i typed:
"AABAC", when i press the button, I want it to transform into:
"11213"

basicly, i want A to equal 1
B = 2
C = 3
etc.

The problem is, when I type "A", it comes up as "1", but when I type "AB"
instead of comming up as "12", nothing come up at all.

please help me
Back to top
View user's profile Send private message
FullyAwesome
I post too much
Reputation: 0

Joined: 05 Apr 2007
Posts: 4438
Location: Land Down Under

PostPosted: Mon Dec 01, 2008 3:02 am    Post subject: Reply with quote

i don't know if this is the proper way to do it, but couldn't you loop for the length of the string, so if the string length (of the textbox text) is 5, you loop from 1 to 5. each time you loop you check the next character at a certain spot of the string and use a switch/select case to check the char. i guess this would work.

your problem i'm guessing is because you're checking if the string is equal to A or B, not a combination.

_________________
Back to top
View user's profile Send private message MSN Messenger
AoiMasamune
Master Cheater
Reputation: 1

Joined: 14 Jun 2007
Posts: 255

PostPosted: Mon Dec 01, 2008 3:08 am    Post subject: Reply with quote

Public Function Translate(strInput as String) as String
Dim iStrLength as Integer = strInput.Length
Dim strReturn as String = ""

For X = 0 to iStrLength - 1
Dim chrTemp as Char = strInput.Chars(x)

Select Case chrTemp
Case Is = "A"
strReturn = strReturn & "1"
Case Is = "B"
strReturn = strReturn & "2"
' etc etc...
End Select
Next X

Translate = strReturn
End Function


That should do it I think.


Last edited by AoiMasamune on Mon Dec 01, 2008 1:28 pm; edited 2 times in total
Back to top
View user's profile Send private message
EvilSparx
Expert Cheater
Reputation: 0

Joined: 29 Nov 2008
Posts: 175
Location: Behind You!

PostPosted: Mon Dec 01, 2008 3:10 am    Post subject: Reply with quote

I put the code in the button, and i got a build error?
_________________
Banhammer = Fail
Back to top
View user's profile Send private message
FullyAwesome
I post too much
Reputation: 0

Joined: 05 Apr 2007
Posts: 4438
Location: Land Down Under

PostPosted: Mon Dec 01, 2008 4:29 am    Post subject: Reply with quote

that's exactly what i was thinking Aoi.

EvilSparx wrote:
I put the code in the button, and i got a build error?


um do you know how to code in vb.net? that's a function, you call it when you click the button, you don't put the code in the button click event.

if you can't get this done yourself, i'll try to help tomorrow. i'm tired so logging off.

_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites