Focal Point
Susannah's cool technique for long SELECT box lists:

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2601077331

January 21, 2004, 12:31 PM
<monte2000>
Susannah's cool technique for long SELECT box lists:
Here's a cool technique for long SELECT box lists:

Group similar items using the OPTGROUP tag, and here's some code to do it.

FILEDEF MYLIST DISK D:\Inetpub\wwwroot\{wherever}\MYLIST.txt
TABLE FILE INPUT
PRINT ITEM_DESCRIP
BY ORDER
BY GROUP
BY GROUPNAME
BY SUBGROUP
BY ITEM_NUMBER
ON TABLE HOLD AS HTEMP FORMAT ALPHA
END
-RUN
-SET &A = ' ';
-SET &B = ' ' ;
-SET &C = ' ' ;
-SET &D = ' ' ;
-SET &E = ' ' ;
-SET &F = ' ' ;
-SET &GROUPHOLD = ' ' ;
-RUN
-REREADSTY1
-READ HTEMP NOCLOSE &A.A2 &B.A1 &C.A34 &D.A2 &E.A8 &F.A20
-IF &IORETURN NE 0 GOTO ENDREAD ;
-IF &B EQ &SEASONHOLD GOTO WRITEIT ;
-SET &OPTLABEL = '<OPTGROUP LABEL = "' | &C || '" >' ;
-* note: closing the OPTGROUP tag is not a requirement. whew.
-WRITE MYLIST &OPTLABEL
-SET &GROUPHOLD = &B ;
-WRITEIT
-SET &OPTION ='<OPTION VALUE = "' | &E | '" >' | &D | ' ' | &F || '</OPTION>';
-WRITE MYLIST &OPTION
-GOTO REREADSTY1 ;
-ENDREAD
-*
and the output file looks like this
<OPTGROUP LABEL = "SPRING 2004" >
<OPTION VALUE = "E03PP604" >DR ALICIA DRESS</OPTION>
<OPTION VALUE = "P0216104" >PS ANASTASIA JACKET</OPTION>
<OPTION VALUE = "P0216114" >PS EFFIE JACKET</OPTION>

and it shows up beautifully in a select box, with the OPTGROUP label in bold and italics, very nicely separating your groups in your select box.