With a multi-select here's what you get.
Say you have a variable called &COUNTY:
If one county is chosen, the value will be in &COUNTY.
If multiple values are chosen, you get this:
&COUNTY0 has the number of values selected;
&COUNTY has the first value selected;
&COUNTY1 has the first value selected;
&COUNTY2 has the second value selected;
....
&COUNTY.&COUNTY0 has the last value.
I usually code it like this. This builds the piece of the WHERE clause for &COUNTY
-*
-* If multiple counties are selected then goto CHK_CNTY;
-*
-IF &COUNTY0.EXISTS GT 0 THEN GOTO CHK_CNTY;
-*
-* One county is selected
-*
-SET &CNTYLINE='AND COUNTY EQ ' | &COUNTY;
-GOTO FINCNTY
-*
-CHK_CNTY
-SET &CNTYLINE='AND COUNTY IN (';
-SET &PASS=1;
-*
-* Append counties selected
-*
-REPEAT LOOP1 &WRSRCTYP0 TIMES
-SET &CNTYLINE=IF &PASS EQ 1
- THEN &CNTYLINE || &COUNTY.&PASS
- ELSE &CNTYLINE || (',' | &COUNTY.&PASS);
-SET &PASS=&PASS+1;
-LOOP1
-*
-SET &CNTYLINE=&CNTYLINE || ')';
-*
-FINCNTY
....
WHERE .....
&CNTYLINE.EVAL
In this case, the &COUNTY is returning numbers. It is a little more complicated for alpha fields because you have to mess with the quotes or use the .QUOTEDSTRING. For example, if I was passing county name instead of the county FIPS code, I might use &CNTYNM.&PASS.QUOTEDSTRING.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.