Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    3

    Grin Generate a predetermined number.

    I want to create a program in autoplay media studio which can generate a given text or password. For instance: the program has 100 given codes like "SP1HK8KADA8D" or any other text. When i press a generate button it sould generate a random code form the 100 given codes. It can't be the same as the last code...

    Also: I'm a noob at AMS.

    Sorry for my broken english :P

  2. #2
    Join Date
    May 2005
    Posts
    1,115
    Code:
    codes={"iugz56erzti", "345345345","345345345","985th85eu"}; --and so on
    
    random=Math.Random(1, Table.Count(codes));
    randomcode=codes[random];
    Never know what life is gonna throw at you.
    (Based on a true story.)

  3. #3
    Join Date
    Feb 2007
    Posts
    3
    I don't get it :s It's my first experience with code. Should i copy the code to the generate button or the input box?

  4. #4
    Join Date
    May 2005
    Posts
    1,115
    Table codes contains all the codes. You might hardcode this table or load it from a file on disk via TextFile.ReadToTable() command. In my example I hard-coded it. This part would go on the page's On StartUp event.

    The other two lines do the actual randomization. First line creates a random number between 1 and the amount of entries in the table. You would put this code on your button.

    What you need next is to somehow display this randomcode variable content to the end user. You might put the password into input field via Input.SetText() command or display it using Dialog.Message().
    Never know what life is gonna throw at you.
    (Based on a true story.)

  5. #5
    Join Date
    Feb 2007
    Posts
    3
    It works! Thank you for your help... I really appreciate it.

Similar Threads

  1. Random Number Generator W/ Check
    By markstaylor in forum AutoPlay Media Studio 6.0
    Replies: 12
    Last Post: 09-18-2006, 12:31 PM
  2. Password Issue
    By katanapilot in forum Setup Factory 7.0
    Replies: 25
    Last Post: 02-10-2006, 09:16 AM
  3. Problem drive's current serial number
    By kurtgamer in forum AutoPlay Media Studio 6.0
    Replies: 3
    Last Post: 12-16-2005, 01:07 PM
  4. HOWTO: Limit the Number of Times an Install can be Run
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-17-2002, 02:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts