× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Larry,

> 2) It would appear that my call-back proc was indeed being called and it was
> the call to system() that was failing. However, I had a debug breakpoint
> within the proc and it was never invoked. Is it a case that call-back procs
> can't be debugged because they get called outside the normal process?

Yes, that is the case.

> 1) If you want to call a procedure from another procedure do you have to
> prototype the called procedure in the calling procedure? I noticed that your
> QCMDEXC PR was within the MyCallBackProc, I had my system() PR in the main
> D-specs. Was that wrong? Is that why it failed?

No, that shouldn't make any difference.   And it also shouldn't make any
difference if you use system() vs. QCMDEXC.

The following uses system() and defines the prototype globally.  It works
fine on my system (V5R2, up-to-date with PTFs as of May)

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

     D system          PR                  extproc('system')
     D   cmd                           *   value options(*string)

     D myCallBackProc  PR
     D   AgMark                      10U 0 options(*nopass)
     D   Reason                      10U 0 options(*nopass)
     D   Result                      10U 0 options(*nopass)
     D   UserRC                      10U 0 options(*nopass)

     D myProcName      PR                  ExtProc('CEE4RAGE')
     D   procedure                     *   procptr const
     D   feedback                    12A   options(*omit)

     c                   callp     myProcName( %paddr(myCallBackProc)
     c                                       : *OMIT )
     c                   eval      *inlr = *on

     P myCallBackProc  B                   export
     D myCallBackProc  PI
     D   AgMark                      10U 0 options(*nopass)
     D   Reason                      10U 0 options(*nopass)
     D   Result                      10U 0 options(*nopass)
     D   UserRC                      10U 0 options(*nopass)

     c                   callp     system('SNDMSG MSG(''I like pie'') ' +
     c                                         'TOUSR(KLEMSCOT)')

     P                 E

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.