1.

Is It There An Easy Way To Determine If An Html Section Is Available To Issue A Wrtsection Upon?

Answer»

After reading the external html (GetHtml, GetHtmlIfs, or GetHtmlIfsMult you can USE the RtvHtmlRcd subprocedure (see member XXXWRKHTML in CGIDEV2/QRPGLESRC). Ask it to retrieve the first RECORD from the section of INTEREST. For example, if 'top' exists and 'xxx' doesn't:

eval rcd = RtvHtmlRcd('top':1:rc) gives rc = 0 
eval rcd = RtvHtmlRcd('xxx':1:rc) gives rc = -1

If you don't care about the contents or the rcd, you can use callp inst of eval:

callp RtvHtmlRcd('top':1:rc) gives rc = 0 
callp RtvHtmlRcd('xxx':1:rc) gives rc = -1

I would recommending using WrtSection for the section only if rc = 0. Return codes -1 and -2 are obvious. You can get return code -3 only if the first parameter is *NONE and the RELATIVE record number is WITHIN a duplicate section.

After reading the external html (GetHtml, GetHtmlIfs, or GetHtmlIfsMult you can use the RtvHtmlRcd subprocedure (see member XXXWRKHTML in CGIDEV2/QRPGLESRC). Ask it to retrieve the first record from the section of interest. For example, if 'top' exists and 'xxx' doesn't:

eval rcd = RtvHtmlRcd('top':1:rc) gives rc = 0 
eval rcd = RtvHtmlRcd('xxx':1:rc) gives rc = -1

If you don't care about the contents or the rcd, you can use callp inst of eval:

callp RtvHtmlRcd('top':1:rc) gives rc = 0 
callp RtvHtmlRcd('xxx':1:rc) gives rc = -1

I would recommending using WrtSection for the section only if rc = 0. Return codes -1 and -2 are obvious. You can get return code -3 only if the first parameter is *NONE and the relative record number is within a duplicate section.



Discussion

No Comment Found