HP3000-L Archives

September 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Mon, 25 Sep 2000 11:42:11 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (59 lines)
Re:
> I want to write my own routine for DBCLOSE, adding some logging and other
> "stuff" and then have the system XL turboimage intrinsic DBCLOSE happen.  I
> have tried adding by own DBCLOSE module to a user XL.  But when the DBCLOSE
> in the user XL calls DBCLOSE, it loops calling the user XL until a NM error
> occurs and never gets to the DBCLOSE in the system XL.
>

(BTW, the real DBCLOSE is in XL.PUB.SYS)

The problem is that the DBCLOSE in your XL is trying to call the real
DBCLOSE...but that simply looks like a recursive call to the linker/loader.

There are two basic solutions:

1) two user XLs

   Create two XLs.  In XL1, put your DBCLOSE.  At the end of that routine,
   when you want to call the real DBCLOSE, call "indirect_dbclose".

   In XL2, put indirect_dbclose.  It's a one line procedure, whose only
   purpose in life is to call the real DBCLOSE.

   link/run your program with:  XL="XL1, XL2, XL.PUB.SYS"

2) loadproc

   Create XL1, with:

      $literal_alias on$
      $subprogram$
      $global$        <-- important in Pascal/iX, to get private & static
                          global variables.
      var
         initialized : boolean;
         dbclose_plabel : dbclose_plabel_type;

      procedure dbclose $alias 'DBCLOSE'$ (...)

         At the point in the routine where you want to call
         the real DBCLOSE, do:

          if not initialized then
             begin
             "loadproc" the real DBCLOSE from XL.PUB.SYS via
             HPGETPROCPLABEL.  Store the plabel in dbclose_plabel.
             If the loadproc fails, abort!

             initialized := true;
             end;

          call (dbclose_plabel, ...(dbclose parameters)...);

Note: the SL-edit trick doesn't work quite as well on XLs, so I'm not
going to describe it.

Stan Sieler                                           [log in to unmask]
www.allegro.com/sieler/wanted/index.html          www.allegro.com/sieler

ATOM RSS1 RSS2