View previous topic :: View next topic |
Author |
Message |
admirzuza How do I cheat?
Reputation: 0
Joined: 03 Oct 2009 Posts: 5 Location: Bosnia & Herzegovina
|
Posted: Sun Oct 18, 2009 9:17 am Post subject: My VB 6 program HELP |
|
|
Hello to all...I'm new on programming forums...I need help about my small program that I'm going to make....but I need help because I don't know how to start...
OK...here is the point... when user puts word in Text1 and click GET ADDRESS, address shows in Text2...but the word has to be exactly the same that is stored in the database...if the user put the word which is not in the database or it is wrong spelled the error pops up "wrong name"
(example: If the word is HOUSE (it's in database) then he clicks the GET ADDRESS button, address shows in the address bar...but if he types HOUS the error pops up " wrong name" )
THAT'S ALL.... any help would be appreciated.... I'M USING VB 6..
Description: |
|
Filesize: |
111.64 KB |
Viewed: |
7415 Time(s) |

|
|
|
Back to top |
|
 |
Jesper Grandmaster Cheater Supreme
Reputation: 9
Joined: 21 Feb 2007 Posts: 1156
|
Posted: Sun Oct 18, 2009 11:30 am Post subject: |
|
|
Not exactly sure what you're talking about but I guess you could try using the inStr() function.
Example:
Quote: |
Dim temp as String
temp = "abc 123"
If ( inStr(temp,"c 1") ) Then
Text2.text = temp
end if
|
|
|
Back to top |
|
 |
admirzuza How do I cheat?
Reputation: 0
Joined: 03 Oct 2009 Posts: 5 Location: Bosnia & Herzegovina
|
Posted: Sun Oct 18, 2009 11:50 am Post subject: |
|
|
OK..I figure out how to get address for one name...but how to add more names and addresses....I think the code is OK Quote: | If Text1.Text = "name here" Then
Text2.Text = "ADDRESS"
Else
msgbox ("wrong spelled or not in database")
End If
End Sub |
|
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sun Oct 18, 2009 1:23 pm Post subject: |
|
|
Use C#, and look into a data structure called a 'Dictionary'/'Map'.
|
|
Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sun Oct 18, 2009 4:06 pm Post subject: |
|
|
Athaem wrote: | Use C#, and look into a data structure called a 'Dictionary'/'Map'. |
map in c#? Isn't that java?
admirzuza wrote: | OK..I figure out how to get address for one name...but how to add more names and addresses |
What? Don't you have the names and addreses in a db? Unless you are trying to fetch all the data once into an array I dont really understand what you are trying to do.
_________________
Intel over amd yes. |
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
|
Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Mon Oct 19, 2009 9:44 am Post subject: |
|
|
so dictionary is the map or what?
_________________
Intel over amd yes. |
|
Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Mon Oct 19, 2009 12:01 pm Post subject: |
|
|
JesusLovesQlimax wrote: | so dictionary is the map or what? |
It's called a Dictionary in C#, but the proper name (at least in my mind) is a 'map'. It's a data structure where you can assign the values in it keys, and you can pass the key to acquire the value. Almost all implementations use a binary tree to find the value, which means it's fast no matter the amount of keys.
I often use them in place of switch statements.
|
|
Back to top |
|
 |
admirzuza How do I cheat?
Reputation: 0
Joined: 03 Oct 2009 Posts: 5 Location: Bosnia & Herzegovina
|
Posted: Wed Oct 21, 2009 10:28 am Post subject: |
|
|
thank you all for replying....I found solution and make my own code....
THREAD CLOSED
|
|
Back to top |
|
 |
|