Set HTML Properties

cgiSetProp

The cgiSetProp procedures changes various settings used by CGILIB when processing HTML documents.

The cgiSetProp procedure is used to set the beginning and end symbols that are used to identify "section" names or "token" names in HTML files. This procedure may be called at any time and is effective when the cgiWrtSection procedure is used to send HTML to the staging output buffer.

nStatus  cgiSetProp(
 nCtrlID               10I 0  Const 
 szProp1               64A    Const Varying
 szProp2               64A    Const Varying OPTIONS(*NOPASS)
)

See also: cgiLoadHtmlIFS, cgiLoadHtml, cgiWrtSection,cgiSetHtmlVar cgiInit

Parameters

nCtrlID
[input Int4(10i0) const]  The control ID for the property being changed. This valid is a symbolic constant that identified which property is being modified. The value choices for this parameter include the following:
szProp1
[input VChar(64) const]  The first property to be set.
 
szProp2
[input VChar(64) const]  The second property to be set.

Return Value

If the function succeeds, the return value is 0.

If the function fails, the return value is less than zero. The possible return code when the function fails include:

-1  -- The nCtrlID parameter is not valid

Remarks

Call cgiSetProp only if you need to override the default beginning and ending symbols used to identify Sections or Tokens in your HTML. HTML properties are case sensitive so be certain that you specify the proper letter case in your HTML and on the cgiSetProp procedure.

Normally this function is not needed.

Example

In the example that follows, the cgiSteProp procedure is used to change the identifying symbols for Tokens in the HTML from the default of '/%' and '%/' respectively to <AS400> and </AS400> respectively.

      /INCLUDE XTOOLS/QCPYSRC,CGI
 
.....DName+++++++++++EUDS.......Length+TDc.Functions+++++++++++++++++++++++++
     D CONTACT         S             20A
     D CMPNAME         S             30A  
     D PHONE           S             11P 0
     D szSrcMbr        S             10A   Inz('ORDERFORM')
 
.....C..n01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++++
     C                   callp     cgiInit()
     C                   eval      CONTACT = cgiGetVar('CONTACT')
     C                   eval      CMPNAME = cgiGetVar('COMPANY')
     C                   eval      PHONE   = cgiGetVarI('PHONE')
     C                   if        cgiLoadHtml('CGILIB/QHTMLSRC':szSrcMbr) <= 0
     C                   callp     wrtjoblog('Could not load HTML mbr %s.':szSrcMbr)   
     C                   endif
     C                   callp     cgiSetProp(CGI_TOKEN:'<AS400>':'</AS400>')