4 Replies Latest reply on Mar 8, 2015 3:09 PM by philmodjunk

    Random Name Generator



      Random Name Generator



      I can already program Filemaker to generate a random student name.  However, with a simple random name generator, the same student could obviously pop up twice within a very short period.  

      I'd like to develop a more sophisticated way of picking a student via random selection from a continually diminishing list of names (those who have yet to be chosen in the latest round).  

      Once all names have been exhausted the random generator will reset to the full list.

      Any advice would be greatly appreciated.

        • 1. Re: Random Name Generator

          Set up a table of names. Define a number field. Put a random number in the number field using Replace Field Contents. Sort your records on this field--which produces a random order much like shuffling a deck of cards. Now "deal" names out from the start of this sorted found set. You need only keep track of which record number in this set was last used. When Get ( recordNumber ) = Get ( foundCount ), you are on the last record in the table and it's time to assign a new random number and sort to "reshuffle" your "deck" of name cards.

          • 2. Re: Random Name Generator

            Hello Brian!

            I use a random name generator in class too,  I didn't do it myself and it doesn't use FM.

            Do you think I could have a look at your random name generator?




            • 3. Re: Random Name Generator

              Many thanks for the guidance Phil.

              Get is a function I have yet to encounter. So I am trying to wrap my head around this. I think I "get" it...will give it a whirl.


              • 4. Re: Random Name Generator

                Get, is a "Swiss army knife" kind of function that can return many different useful values depending on the parameter used. I strongly recommend that all developers new to FileMaker look up this function in Help and review the many possible parameters and the results that are possible with each.