TechTip: More V5R1 RPG IV Enhancements

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Second, calls between C and RPG that have parameters passed by value of any of the following types may not have the parameter passed correctly:

RPG
C
1A
char
1C
wchar
5I 0
short
5U 0
unsigned short
4F
float


To alleviate this problem, you can use a special new value for the first parameter of EXTPROC to indicate that a procedure is to be used with ILE CL (*CL) or ILE C (*WIDEN and *NOWIDEN). When the C version of the prototype has #pragma argument(nowiden), use *NOWIDEN:

D calledByCl      pr       extproc(*CL:'CALLEDBYCL')
D cFunction       pr       extproc(*CWIDEN:'cFunction')
D cFunctionNW     pr       extproc(*CNOWIDEN:'cFunctionNW')


You can use this form of EXTPROC for procedures written in any language, including RPG.

Third, use the (A) operation extender on the DUMP op code to produce a formatted dump always, independent of the DEBUG keyword.

Fourth, the new ELSEIF op code, used in conjunction with IF and ENDIF, provides an alternative to SELECT WHEN WHEN ENDSL.

Fifth, the search string for %SCAN can now be longer than the string to be searched. In this case, %SCAN will return 0.

Finally, the OFLIND keyword now allows a named indicator.

--Barbara Morris
IBM Toronto

BLOG COMMENTS POWERED BY DISQUS