Bruce
Using the ListOF function you could try something like this
Buddy
SELECT (LISTOF(CalMonthAbbr)) INTO vCalMonthList INDIC Iv1 +
FROM zMonth WHERE ...
IF vHumpty NOT IN (.vCalMonthList) THEN
--dosomething here
Endif
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Bruce A.
Chitiea
Sent: Friday, July 26, 2013 1:15 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - SELECT not allowed within IF statement
All:
What I need to do is test a variable against a list of values within an IF
statement.
This works:
IF vHumpty NOT IN +
('JAN','FEB','MAR', ... 'DEC') THEN
I'd rather avoid hard-coding the values; preferring to pull values
dynamically.
All the following attempts fail, producing this error message:
'-ERROR- Sub-SELECTs are not supported by this command. (2310)'
This fails:
IF vHumpty NOT IN +
(SELECT CalMonthAbbr FROM zMonth) THEN
As does this:
SET VAR vDumpty TEXT = +
'(SELECT CalmonthAbbr FROM zMonth)'
IF vHumpty NOT IN +
&vDumpty THEN
As does this:
SET VAR vGrimmBros TEXT = +
'(SELECT CalMonthAbbr FROM zMonth)
SET VAR vDumpty TEXT = .vGrimmBros
IF vHumpty NOT IN +
&vDumpty THEN
It must be real simple. I'm just not seeing it.
TIA
Bruce