blog icon indicating copy to clipboard operation
blog copied to clipboard

Using printf (from free-format)

Open worksofliam opened this issue 5 years ago • 0 comments

The printf function in C is very useful when starting to develop new programs. I'm not a big fan of using DSPLY.. and I've found something I much prefer! The printf function inside of your RPG programs.

Firstly, we must declare our prototype at the top of our program:

Dcl-Pr printf Int(10) ExtProc('printf');
  format Pointer Value Options(*String);
END-PR;

Then we can use it like so:

printf('testing!!!');

*Inlr = *on;
Return;  

The result is this, look how pretty it is:
image

worksofliam avatar Jul 07 '19 02:07 worksofliam