For Programmers: Free Programming Magazines  


Home > Archive > Rexx > August 2006 > How to express 'BETWEEN' range









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to express 'BETWEEN' range
p175

2006-08-11, 7:02 pm

How do I write a statement that is true only when a variable falls
between two values as in 2 - 5 ?

is this it ?: if x >= 2 | x <= 5 then ...

I would have thought rexx might support something like SQL where you
can say 'if x between 2 and 5 then ...'

Cheers

Gerard Schildberger

2006-08-11, 7:02 pm

| p175 wrote:
| How do I write a statement that is true only when a variable falls
| between two values as in 2 - 5 ?
|
| is this it ?: if x >= 2 | x <= 5 then ...

No.

It should read: if x>=2 & x<=5 then ...

| I would have thought rexx might support something like SQL where you
| can say 'if x between 2 and 5 then ...'


p175

2006-08-11, 7:02 pm

Thanks Gerard, so the '|' is an OR then huh ?

Cheers adn thanks again.

Gerard Schildberger

2006-08-11, 7:02 pm

| p175 wrote:
| Thanks Gerard, so the '|' is an OR then huh ?

Yuppers.


| Cheers adn thanks again.



Walter u. Christel Pachl

2006-08-12, 4:00 am

and I always 'show' the between by writing
If 2<=x & x<=10 Then... /* x is between 2 and 10 - inclusively */
Walter

"Gerard Schildberger" <Gerard46@rrt.net> schrieb im Newsbeitrag
news:ZNudnc6MTaU9U0HZnZ2dnUVZ_sOdnZ2d@on
voy.com...
>| p175 wrote:
> | How do I write a statement that is true only when a variable falls
> | between two values as in 2 - 5 ?
> |
> | is this it ?: if x >= 2 | x <= 5 then ...
>
> No.
>
> It should read: if x>=2 & x<=5 then ...
>
> | I would have thought rexx might support something like SQL where you
> | can say 'if x between 2 and 5 then ...'
>
>



Dave Saville

2006-08-12, 4:00 am

On Fri, 11 Aug 2006 13:39:49 -0500, Gerard Schildberger wrote:

>| p175 wrote:
>| How do I write a statement that is true only when a variable falls
>| between two values as in 2 - 5 ?
>|
>| is this it ?: if x >= 2 | x <= 5 then ...
>
>No.
>
>It should read: if x>=2 & x<=5 then ...


Inside a range is and (&) as above, outside a range is or (|)

if x <2 | x > 5 then

--

Regards

Dave Saville

NB Remove -nospam for good email address


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com