Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9

Thread: Randomising!

  1. #1
    Join Date
    Sep 2000
    Location
    Redditch, Worcs., UK
    Posts
    20

    Randomising!

    Is there a way of AMS generating a random number?

    eg I want to create a list of 'Tips for the day', then randomly select from the list (either in a .INI file or in the registry).

    If not random, i'd even be happy with a counter, to store an incrementing value every time the CD is run. Then recall this value and pick the corresponding tip.

    The only way I can see at the moment is a quick VB program to write the random seed, and run this whenever the CD starts.

    [Hint: to create a checkbox, create two graphics - one with an empty square and one with a 'check'. Standard graphic is the empty box, then show the 'checked' box on a mouse click event - at the same time set a variable '%checked%'. Then using a bit of boolean, you can return to unchecked next time the box is clicked. ie to disable my 'Tip of the day' once I've got it working http://www.indigorose.com/ubb/images/icons/smile.gif ]

  2. #2
    Join Date
    May 2001
    Location
    dallas, tx, USA
    Posts
    81

    Re: Randomising!

    Set your menu so that the on project open it reads the registry for tip number. Then it would display a tip coresponding to that number if %checked% equlas checked. Then when you click close on the tip box, it would write a new value to the registry for the next tip number. Next time menu is run, it would read the new value, and show the new tip.

    IE. the menu reads a value of 1 as the tip number. It also reads %*check% as checked. It then SHOW OBJECT tip1. The user closes the chek box, which then writes a value of 2 as the tip number in the registry. Next time menu is ran, it reads a value of 2 and checked, then shows obect tip2.

    The explanation may kinda suck, but it should be pretty easy to do. Im adding this feature to mine, just haven't coded it yet
    http://www.indigorose.com/ubb/images/icons/frown.gif. Good idea for the check box. I may have to steal it from you.

  3. #3
    Join Date
    Sep 2000
    Location
    Redditch, Worcs., UK
    Posts
    20

    Re: Randomising!

    Thanks dallas - good plan. Use the mouseclick event on a 'close' button, Tip1 text = "Hello this is tip one", Tip1Val=2.

    So...When Tip1Val is set, the next tip to load is '2', which has text of "Blah" and Tip2Val=3.

    It 'thinks' right, but I'll have to code it and see.

  4. #4
    Join Date
    May 2001
    Location
    dallas, tx, USA
    Posts
    81

    Re: Randomising!

    If you need any help coding, let me know. I'll write it and email it to you. Remember registry is your friend. Use it to the fullest extent possible.

  5. #5
    Join Date
    Sep 2000
    Location
    Redditch, Worcs., UK
    Posts
    20

    Re: Randomising!

    Thanks dallas. I'll let you know how i get on. As far as i can see, two variables are needed for each tip - one with the text, and one with the next tip value, unless there's a way of doing math(s) in AMS.

  6. #6
    Join Date
    May 2001
    Location
    dallas, tx, USA
    Posts
    81

    Re: Randomising!

    thats how im seeing ti for now. havent really played with it yet, but that would be easiest way

  7. #7
    Join Date
    Sep 2000
    Location
    Redditch, Worcs., UK
    Posts
    20

    Re: Randomising!

    ...or of course use the 'increment' option when modifying an existing registry key.

  8. #8
    Join Date
    May 2001
    Location
    dallas, tx, USA
    Posts
    81

    Re: Randomising!

    at the last tip though, you would need it to set back to 1

  9. #9
    Join Date
    Sep 2000
    Location
    Redditch, Worcs., UK
    Posts
    20

    Re: Randomising!

    Hi dallas. Solved it using an ini file. mail me if you want to have a look at the ams file: matthew.walters@thorlux.co.uk

Posting Permissions

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