|
-
May 9th, 2009, 01:40 PM
#1
Thread Starter
Hyperactive Member
Pulling street based on city provided from a list?
I don't know what you would call it but I want to do something like this:
I have a list that contains the following and will have more in the future.
{buffalo}
street
street2
street3
{end}
{albany}
street1
street2
street3
street4
{end}
Now I want to create a function where I can pull a random street from the city I call, for example:
msgbox PullStreet(albany)
and the above might return "street3"
-
May 9th, 2009, 01:42 PM
#2
Re: Pulling street based on city provided from a list?
how is the list provided? is it a textfile?
-
May 9th, 2009, 02:55 PM
#3
Thread Starter
Hyperactive Member
Re: Pulling street based on city provided from a list?
Yes. I could also load it into a listbox at runtime if that would be easier.
I need to pull a random street line from the city I provide when I call the function.
-
May 9th, 2009, 04:08 PM
#4
Re: Pulling street based on city provided from a list?
I assume you have no problem getting the list of entries for each city, given what you've said so far.
You need to look at the Random class provided by the .Net framework.
This article will give you some pointers. You just need to set the relevant maximum value and bob's your uncle!
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
|