Hope you all had a good Easter.
I have created a DB for a poker tournament where players receive a varying amount of chips for a “grand final” event.
To make it fair for all players, we need to distribute the large stacks and the small stacks evenly.
I populated a portal that shows:
Players::PlayersName, Players::ChipTotal, Players::TableNumber and Players::SeatNumber.
The portal is sorted by Players::ChipTotal, highest to lowest and then Players::TableNumber lowest to highest.
I have a field - Event::TablesRequired, that the user can specify how many tables will be required for the grand final.
Each table will hold 10 players, so let's assume there will be 180 players, the user would enter 18 into the field Event::TablesRequired
(total players / 10)
What I need assistance with is how to write a script to:
Go to the first portal row. Set field Players::TableNumber to 1
Go to next portal row. Set field Players::TableNumber to 2
And continue until this sequence is completed the specified x number of times that was entered in the field Event::TablesRequired.
The script then needs to go to the next portal row where the Players::TableNumber is blank (in this example, 19) and continue the same sequence as above and again and again until all portal rows have table numbers filled. Basically 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 looped Ten times.
Once the script has ended the original portal sort would cause players on the same table number to be grouped together.
I would then need another script that would insert the following sequence of numbers into the Players::SeatNumber 10,3,8,4,1,9,6,2,5,7. 18 times – or x number of times that was entered in the field Event::TablesRequired.
I am using FMP12 Adv with Windows 10.
Any help at all would be greatly appreciated.