I'm trying to use the regular expressions API's REGCOMP(), REGEXEC(), and REGFREE(). My text says handle them like a procedure, article seems missing info. Error examples are Prototyped call can't be used in an expression because it doesn't return a value, Types/Attributes of parm don't match the prototype, Parameter can't be passed by reference, etc. Need an example that covers all the bases. These are the lines in error: D REGCOMP PR ExtPgm('REGCOMP') D 30a D 3000 Const OPTIONS(*VARSIZE) D 12a D Reg 30a D Expr 3000 Varying D Flag 12a D REGEXEC PR Extpgm('REGEXEC') D 30a D 50a D 1S 0 Value D 50a D 1S 0 Value D ParmE1 30a D ParmE2 50a D ParmE3 1S 0 D ParmE4 50a D ParmE5 1S 0 D D REGFREE PR Extpgm('REGFREE') D 50a D
D ParmF1 50a
/free rc = REGCOMP(myREG : regexpression : REG_EXTENDED); if (rc = 0); rc = REGEXEC(myREG : afpart : 1 : myMatch: 1); endif; REGFREE(myREG); /end-free
Thanks for your help.
Software/Hardware used:
RPGLE, /free, V6R1
ASKED:
June 16, 2011 6:46 PM
UPDATED:
June 20, 2011 1:25 PM