dpb
Posts:
6,677
Registered:
6/7/07
|
|
Re: While loop with two conditions?
Posted:
Nov 21, 2012 9:15 AM
|
|
On 11/21/2012 7:52 AM, Sensible Man wrote: > "Nasser M. Abbasi" <nma@12000.org> wrote in message > <k8ikrc$do$1@speranza.aioe.org>... >> On 11/21/2012 7:12 AM, Sensible Man wrote: >> > I'm sure this is a very simple question, but is it possible to >> create a while >> >loop with two initial conditions? >> > >> > I basically need >> > >> > while x<3, or y>500, >> > >> > execute loop >> > >> > end if either x<3 or y>500 is met >> > >> >> for scalars, use || >> >> ------------------ >> x=2; y=603; >> >> while x<3 || y>600 >> x=x+1 >> y=y-1 >> end >> ------------------ > > Awesome thanks. However, when I run the code you provided above, the > while loop doesn't terminate when x>3, it only seems to stop when y>600?
Well, you asked for 'OR' :) Maybe you intended AND...
--
|
|