>
> I am trying to use the printf() function in my RPG program. I believe I set
> everything up correctly (compiles and runs), but I don't see the result of
> the printf function.
>
> Where does it go?

The output will appear as soon as you print a newline, and disappear as
soon as your program ends.   That was always my problem with using
something like printf, the output disappeared when my program ended, so it
was just a flash on the screen.

Nowadays, you can just run your program from QSHELL to avoid that problem.

Here's a sample program that uses printf.  Maybe that'll help you see
what you're doing wrong (since you didn't post your code, it's really hard
for us to debug it...)

     H DFTACTGRP(*NO) BNDDIR('QC2LE')

     D sleep           PR            10U 0 extproc('sleep')
     D   seconds                     10U 0 value

     D printf          PR            10I 0 extproc('printf')
     D   format                        *   value options(*string)
     D   arg1                        10I 0 value options(*nopass)
     D   arg2                        10I 0 value options(*nopass)

     c                   callp     printf('copied %d of %d bytes'+x'25':
     c                                     5: 10)
     c                   callp     sleep(10)

     c                   eval      *inlr = *on

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.