Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3017 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a database full of backgammon positions.  Each poses a problem with a correct answer and I've set up a nifty layout with a global field for the user to enter his answer, and other fields that reveal commentary on the proper play once the user has entered the proper answer.  I have descriptive fields set up that allow the user to Find problems on various themes that he or she  might want to work on.So far so good!   

Now what I'd like to do is write a script that scrambles the order of the problems, or selects them randomly.  I see that there is a "Random" calculation function that will generate a random number between 0 and 1 . . . but I'm not seeing my way to how to implement this.   I'm guessing maybe I could multiply the Count of records by Random and then maybe multiply the result by 1 or 10 or 100 depending on how many records there are and then use that as the Record Number that gets chosen?

Does this seem like the right approach?  I'm guessing this might be a fun use of Filemaker people have deployed in similar situations to good effect, and I'm guessing there are clever approaches I'm not thinking of.  Suggestions appreciated!

Posted
13 minutes ago, Wickerman said:

write a script that scrambles the order of the problems ...

To sort records in random order, define an unstored calculation field (result is Number) =

Random

and sort by this field.

 

13 minutes ago, Wickerman said:

... or selects them randomly.

To go to a random record from the current found set, do:

Go to Record/Request/Page [ No dialog; Int (Random * Get ( FoundCount ) ) + 1 ]

 

  • Like 1

This topic is 3017 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.