Katy,
When you pass only one parameter from your selection HTML WebFOCUS only passes the Variable (in this case) &Team.
When you pass mulitple values then WebFOCUS will pass -
&Team - The first value selected
&Team0 - The number of values being passed
&Team1 - The first value selected (same as &Team!)
&Team2 - The second value selected
etc.
The way I would code for this (not necessarily the best method
) using your supplied code is -
-SET &T = 'AND ((TEAM EQ ''&Team.EVAL'')';
-IF &Team0.EXISTS NE 1 THEN GOTO OUTLOOP;
-REPEAT OUTLOOP FOR &COUNTER FROM 2 TO &Team0;
-SET &TEAMNEU= &Team.&COUNTER;
-SET &T = &T | ' OR (TEAM EQ ''&TEAMNEU.EVAL'')';
-OUTLOOP
-SET &T = &T | ')';
-DONE
Although as I mentioned in my PM I would prefer to use the CONTAINS verb rather than multiple ORs -
-SET &T = '(''&Team.EVAL''';
-IF &Team0.EXISTS NE 1 THEN GOTO OUTLOOP1;
-REPEAT OUTLOOP1 FOR &COUNTER FROM 2 TO &Team0;
-SET &TEAMNEU= &Team.&COUNTER;
-SET &T = &T | ',''&TEAMNEU.EVAL''';
-OUTLOOP1
-SET &T = &T | ')';
-DONE
And then in your Fex you would add the WHERE clause -
WHERE &T.EVAL CONTAINS TEAM
Even if there is only one value selected, the WHERE clause will still function correctly.
I have tested both of these using default values of -
-DEFAULT &Team = 'Team 1';
-DEFAULT &Team0 = 5;
-DEFAULT &Team1 = 'Team 1';
-DEFAULT &Team2 = 'Team 2';
-DEFAULT &Team3 = 'Team 3';
-DEFAULT &Team4 = 'Team 4';
-DEFAULT &Team5 = 'Team 5';
and the first method produces -
AND ((TEAM EQ 'Team 1') OR (TEAM EQ 'Team 2') OR (TEAM EQ 'Team 3')
OR (TEAM EQ 'Team 4') OR (TEAM EQ 'Team 5'))
whereas the second method produces -
WHERE ('Team 1','Team 2','Team 3','Team 4','Team 5') CONTAINS TEAM
If you remove the default for &Team0 (to simulate one selection) then you get -
AND ((TEAM EQ 'Team 1'))
or
WHERE ('Team 1') CONTAINS TEAM
respectively, both of which are valid syntax.
Good luck
Tony