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"
Re: Pulling street based on city provided from a list?
how is the list provided? is it a textfile?
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.
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!