Generating a random number.

Question:

Is it possible to set the application to generate a random number?

Solution:

Yes, it is.

To do so, use the following script:

MaxValue = 10
MinValue = 50
Range = MaxValue – MinValue

‘Starts the random numbers generator
Randomize

‘Applies the formula
RandomValue = Round((Range * Rnd) + MinValue)

Randomize function generates a random number between 0 (which can be generated) and 1 (which cannot be generated).  We use the formula to set the necessary values interval, according to what you need in the application.

NOTE: Attached to this article is a sample application developed with E3 V3.2 B255.

Attachments:

ProjRandom en

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Deixe seu Comentário

Seu endereço de e-mail não será publicado. Campos marcados com asterisco são obrigatórios *