Results 1 to 5 of 5

Thread: randomize messages

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    I am using ms agent, and every time it moves, I want a diffrent message to apear random

    please help

    thanks in advance
    NXSupport - Your one-stop source for computer help

  2. #2
    Guest
    This will generate a random message:

    Code:
    Private Sub Command1_Click()
    Randomize
    retVal = Int((5 * Rnd) + 1)
    If retVal = 1 Then MsgBox "Message #1"
    If retVal = 2 Then MsgBox "Message #2"
    If retVal = 3 Then MsgBox "Message #3"
    If retVal = 4 Then MsgBox "Message #4"
    If retVal = 5 Then MsgBox "Message #5"
    End Sub
    Get the point? Hope this helps.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    YOu could use Choose like this:
    Code:
    Msgbox Choose(int(Rnd*5+1),"M1","M2","M3","M4","M5")
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    ok, thanks to both for your help
    NXSupport - Your one-stop source for computer help

  5. #5
    Guest
    If you need more information about messaggeboxes, Check it out.

    http://forums.vb-world.net/showthrea...threadid=25670

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