how to get each time different number while running application in vb6...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Suprim
    New Member
    • May 2010
    • 8

    #1

    how to get each time different number while running application in vb6...

    Hi...I want to get the different random number for each time when the application is run. For example : When i run the application, if i got 3 as the random number for the first time then when i close and open the application again i want to get number expect than 3 as the first number...If anyone can than please help me ..it's really urgent..
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    I think you will have to store the used numbers in a database, or at least write them to a text file, then open the DB /file at every run, load numbers into an array then check against the array

    Comment

    • Guido Geurs
      Recognized Expert Contributor
      • Oct 2009
      • 767

      #3
      Originally posted by Suprim
      Hi...I want to get the different random number for each time when the application is run. For example : When i run the application, if i got 3 as the random number for the first time then when i close and open the application again i want to get number expect than 3 as the first number...If anyone can than please help me ..it's really urgent..
      dear,

      You can also just write it to a file and load it in an array when you start the program.
      attached is an example ?

      br,
      Attached Files

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        As already suggested you need to store all the already generated / used numbers somewhere. Preferable store in a database table.

        Comment

        • Suprim
          New Member
          • May 2010
          • 8

          #5
          Thank to all. It really works well. Now i can applied it to my program. Thank you once again to all.

          Comment

          Working...