Randomly selecting from a table and making sure it's not already chosen
LyboTech
Member Posts: 135
I'm fairly new to tables, but I'm going to use it for my new project and I'm wondering how this could be done:
I have a series of questions in a table and want to select 5 for example, how can I choose 5 of those, store it in
another table and make sure none of the questions have already been drawn from the table ?
Best Answer
-
gyroscope I am here.Posts: 6,598
Hi @LyboTech the principal is to use your random from 1 to the max. amount of rows in your (copied) table, then each time that particular row is chosen, its deleted, so it can't be picked again.
Here's a little test for you to see what I mean:
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
@gyroscope Cheers buddy, helped a lot
@LyboTech You're welcome.
As is usual with Vanilla, it's forgotten the test file with my answer, so here it is again if it can help anyone else at some time:
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps