| Centering a Text String |
|
|
|
The RPG IV language introduces several powerful built-in functions that simplify string-handling requirements. You can add a few more string-related procedures to come up with a complete toolbox for processing text. The Centertext procedure centers a string field, a function that's handy for centering headings on reports and displays. Here's the procedure code for Centertext: // ------------------------------------------------------------------
To use the Centertext procedure, a calling procedure must include the following prototype: // ------------------------------------------------------- Prototypes
When you want to center a text string, you can include the procedure call in an assignment expression. One or two parameters are necessary:
The procedure returns a 256-byte value, with the text centered in the length you specify: Heading = Centertext('Company: ' + Cpyname : 80);
When you bind the program, be sure to include the module or service program that contains the Centertext procedure: CRTPGM PGM(library/program) MODULE(library/program library/CENTERTEXT) |
Special pricing for the Glendora area. Book a 5-day onsite class for as little as USD $800/day. Get a price quote today. Ask for offer CA800.
5-day minimum, special terms apply.