Learn from sources
       Member HELLO1 in CGIDEV2 / QRPGLESRC

       *********************************************************************
       *  RPG ILE MODULE CGIDEV2/HELLO1
       *
       *  After compiling this RPG MODULE,
       *  create the related program with the following command:
       *
       *  CRTPGM CGIDEV2/HELLO1 MODULE(CGIDEV2/HELLO1 CGIDEV2/RTVOSRLS)
       *         ACTGRP(C2HELLO1) AUT(*USE)
       *
       *********************************************************************
       *  Input HTML parameters
       *
       *                        VARIABLE         MEANING
       *                        lng=             national language
       *                        firstname=       first name
       *                        lastname=        last name
       *
       *********************************************************************
       /copy CGIDEV2/qrpglesrc,hspecs
       /copy CGIDEV2/qrpglesrc,hspecsbnd
       *--------------------------------------------------------------------
       * Variables common to all CGIs
       *--------------------------------------------------------------------
       /copy CGIDEV2/qrpglesrc,prototypeb
       /copy CGIDEV2/qrpglesrc,usec
       /copy CGIDEV2/qrpglesrc,variables3
       * Variables parsed from input query string
      D lng             s              2a
      D firstName       s             40a
      D lastName        s             40a
       * Other variables
      D OSRls           s              9a
      D qccsid          s              5a
       *=====================================================================
       * PROCESS
       *=====================================================================
       * Write qualified job name to debug file (optional).  The *on
       * parameter forces output even if debugging is off.
       * Remove this parameter or change it to *off if you
       * want the output only if debugging is on.
      C*                  callp     wrtjobdbg(*on)
      C                   callp     wrtjobdbg
       * Receive query string from the browser
       /copy CGIDEV2/qrpglesrc,prolog3
       * Parse it into program variables
      C                   eval      lng = zhbgetvarupper('lng')
      C                   eval      firstName = zhbgetvar('firstname')
      C                   eval      lastName  = zhbgetvar('lastname')
       * Load external HTML
      C                   callp     gethtml('DEMOHTML' + %trimr(lng):
      C                             'CGIDEV2':
      C                             'HELLO1')
       * Retrieve current OS/400 release
      C                   callb     'RTVOSRLS'
      C                   parm                    OSRls
      C                   parm                    qccsid
       * Set html output variables
      C                   exsr      SetVar
       * Send sections
      C                   callp     wrtsection('top')
      C                   if        qccsid = '65535'
      C                   callp     wrtsection('warn')
      C                   endif
       * Quit
      C                   exsr      Exit
       *=====================================================================
       * Close output html and quit
       *=====================================================================
      C     Exit          begsr
       * Do not delete the call to wrtsection with section name *fini.  It is needed
       * to ensure that all output html that has been buffered gets output.
      C                   callp     wrtsection('*fini')
       * Quit
      C                   return
      C                   endsr
       *=====================================================================
       *  Set HTML output variables
       *=====================================================================
      C     SetVar        begsr
       * First name (and clear all HTML output variables)
      C                   callp     updHTMLvar('FIRSTNAME':firstname:
      C                             '0')
       * Last name
      C                   callp     updHTMLvar('LASTNAME':lastname)
       * Current OS/400 release
      C                   callp     updHTMLvar('OSRLS':OSRls)
       *
      C                   endsr
0.028 sec.s