Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easy one But I forgot. If n = 0, or n = 1
Message
From
10/06/2013 21:04:43
 
 
To
10/06/2013 20:32:37
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01575918
Message ID:
01575969
Views:
72
(pointing out the obvious) This of course using BETWEEN makes the assumption that the expression can be expressed as a contiguous range of values (i.e. you don't need to exclude values within the range). It's OK as long as the question can indeed be expressed as "if X is between A and Z then ..", rather than being more of "if X is A, B, C or D then ..." (w/ potential for adding conditions T, X, and Y).

Anyway... examples of BETWEEN:
IF BETWEEN(n,1,3) THEN
    ...
ENDIF
would be the same as:
IF n >= 1 AND n<=3 THEN
    ...
ENDIF
And in SQL
SELECT ... FROM ... WHERE N BETWEEN 1 AND 3
would be equivalent to:
SELECT ... FROM ... WHERE N>=1 AND N<=3
>BETWEEN
>
>>What is the function to replace a statement like
>>
>>if n = 1 or n = 2 or n = 3
>>
>>by something shorter. I thought it would be something like if n in(1,2,3)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform