Hi I need some help with a loop

I want a random number to be generated that is not equal to 3 different, and previously defined variables.

The loop I have is like this one below

random = randomNum.next(0, 10)
while random = first or second or third
random = randomNum.next(0, 10)
end while

first, second, and third are previously defined short integers that have different values.

I thought this would work however my program gets stuck in an endless loop =(

How do I define more than one requirement for a while loop? Apparently or isn't working for me :(

to simplify my question I want to know how to keep a loop going until more than one requirement is met

for example

while x <> y
blah blah blah
end while

say I wanted to have the loop run until x was not equal to either y or z, how would I word this? thanks

Hi I need some help with a loop

I want a random number to be generated that is not equal to 3 different, and previously defined variables.

The loop I have is like this one below

random = randomNum.next(0, 10)
while random = first or second or third
random = randomNum.next(0, 10)
end while

first, second, and third are previously defined short integers that have different values.

I thought this would work however my program gets stuck in an endless loop =(

How do I define more than one requirement for a while loop? Apparently or isn't working for me :(

i will go with

Randomize()
variablename=0+Int(Rnd()*10)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.