Learn from sources
       Member TAGOPT in CGIDEV2 / QRPGLESRC

       *=============================================================================================
       * TAGOPT - Example about using subprocedure CrtTagOpt
       *
       * CRTBNDRPG PGM(CGIDEV2/TAGOPT) SRCFILE(CGIDEV2/QRPGLESRC)
       *           DFTACTGRP(*NO) ACTGRP(TAGOPT) DBGVIEW(*SOURCE)
       *
       *=============================================================================================
       /copy CGIDEV2/qrpglesrc,hspecs
       /copy CGIDEV2/qrpglesrc,hspecsbnd
       /copy CGIDEV2/qrpglesrc,prototypeb
       /copy CGIDEV2/qrpglesrc,variables3
       /copy CGIDEV2/qrpglesrc,usec
      D dates           s             15    dim(3)
      D i               s             10i 0
      D optionValue     s            200    varying
       /free
            // load dates
            dates(1)='Oct 1, 2011';
            dates(2)='Nov 3, 2012';
            dates(3)='Dec 7, 2013';
            // load external html
            gethtml('DEMOHTML':'CGIDEV2':'TAGOPT');
            // start response
            wrtsection('top');
            // provide option list
            for i=1 to 3;
               optionValue=CrtTagOpt(%char(i):dates(i));
               updhtmlvar('optionvalue':optionValue);
               wrtsection('seldate');
            endfor;
            wrtsection('endseldate');
            // send response and return
            wrtsection('*fini');
            return;
0.023 sec.s