Results 1 to 4 of 4

Thread: Pulling street based on city provided from a list?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2007
    Posts
    360

    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"

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Pulling street based on city provided from a list?

    how is the list provided? is it a textfile?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2007
    Posts
    360

    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.

  4. #4
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    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
  •  



Click Here to Expand Forum to Full Width