Results 1 to 5 of 5

Thread: textbox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 1999
    Posts
    204
    hey im trying to random a num,ber in a text box is this how i do it
    Text1.Text = 0 <> 100
    Text2.Text = 0 <> 100
    yeah im kinda new to this

  2. #2
    Guest
    Here's an example of Random numbers.

    Code:
    Randomize Timer
    MyNum = Int(Rnd * 100) + 1
    
    Text1.Text = MyNum

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    rnd returns a "random" value between 0 and 1
    rnd -1 will reset the random number generator
    randomize will simulate randomization by using that value as a seed to the next random values, using timer as Meg showed will generate different values each time you execute, simulating randomness
    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
    Guest
    Also, the + 1 is there so the number can be 100, else, it will only go from 0-99.

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Meg, what do you prefer option base 1 or 0 when you create arrays? I prefer 0 and i'm annoyed with listview, treeview and classcollection
    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.

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