Results 1 to 3 of 3

Thread: real easy one...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Dullawhere
    Posts
    100
    if i want to display a random integer from 1 - 999 then what kind of code should i do...

    Text1.Text = ...............?

  2. #2
    Addicted Member Michael Woolsey's Avatar
    Join Date
    Nov 2000
    Location
    Calgary, Alberta, Canada.
    Posts
    243
    I put this code in a new project, its also assuming you have a text box named Text1.


    Code:
    Private Sub Form_Load()
      Randomize
      Text1.Text = Int((999 * Rnd) + 1)
    End Sub
    Hope this helps.
    Michael
    Application/Web Developer

    Visual Basic 6.0 SP5
    Active Server Pages
    Oracle 9i
    - I'm going to live forever, or die trying!

  3. #3
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158
    put randomize in form load

    and use:

    Code:
    text1.Text = int(rnd * 999) + 1

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