Bonjour
Je voudrais savoir comment je peux generer un nombre de facon automatique dans SuSo
You cannot “generate” random numbers in your questionaire.
However, each interview gets a random number assigned during creation.
You can reference this number in your questionnaire expressions as:
Quest.IRnd()
It will return a single double precision number between 0 (included) and 1 (excluded).
There are several posts on this forum discussing techniques for using random numbers in interviews.
You’ll find lots of additional information.
Merci beaucoup cher @klaus
Maintenant, quelle est la syntaxe pour me permettre d’extraire un nombre de 4 chiffres aléatoire parmi les 16 générés précédemment
Merci bien
See the discussion here:
Say you want a number between 1 and 9999:
Then the expression
(long) Math.Floor(((decimal)Quest.IRnd())*(decimal)9999) + 1
would return it.
You can also substitute 9999 by the variable of a numeric question, say, numberRooms.
The expression would then randomly select the number of one of the rooms.