I'm doing a form which selects random questions from a DB, the number of questions is determined by the administrator, but good. Always at the beginning of the questionnaire (Web Panel - Event Start) random questions are selected by this way.
Event Start
&a = 1
Do While
&preguntaSeleccionada.Add(Random() * &CantidadPreguntas)
&a = &a + 1
EndDo
EndEvent
By multiplying the " Random() * &cantidad
" this gives me numbers from 1 to the last question I have, but there are moments (very little) that are repeated and the idea is not that.
I would like to know if while that Do While
works, there is some way to validate that when you do a " &coleccon.Add(&item)
" do not enter if there is already an equal data.
Working with Gx15u8 - Java Web