Results 1 to 5 of 5

Thread: Drawing a random folder

  1. #1
    rwilliams
    Guest

    Drawing a random folder

    Ok, I need help figuring out how to draw a random folder from the C drive, and then storing it to a variable, any ideas?

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    I would say...first get ALL folder into an array...

    the do a count and random draw from the array.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    add a DirListBox to your folder, set the visible prop to False, add a command button, and this code :
    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.   Randomize Timer
    4.  
    5.   Dir1.Path = "C:\"
    6.  
    7.   x = Int((Dir1.ListCount-1) * Rnd)
    8.  
    9.   MsgBox Dir1.List(x)
    10.  
    11. End Sub

    That would be easiest

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    ok...fine..so that would work too

    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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