Skip to content

Instantly share code, notes, and snippets.

@qpgmr-de
Last active May 6, 2020 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qpgmr-de/5150a1ef10c188a06174436017b146b1 to your computer and use it in GitHub Desktop.
Save qpgmr-de/5150a1ef10c188a06174436017b146b1 to your computer and use it in GitHub Desktop.
IBM i full free ILE-RPG print procedure
dcl-proc print;
//--------------------------------------------
// usage:
// ...
// print('Message');
// ...
// /COPY PRINT
//--------------------------------------------
dcl-pi *N;
pMsg VarChar(5000) Const;
end-pi;
dcl-pr printf ExtProc(*DCLCASE);
*N Pointer Value Options(*STRING);
*N Int(10) Value Options(*NOPASS);
end-pr;
dcl-c LF Const(x'15'); // Newline/LF
dcl-s myMsg VarChar(5001) Inz;
myMsg = %Trim(pMsg) + LF;
printf(myMsg);
return;
end-proc print;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment