HP3000-L Archives

September 1997, Week 1

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:
Lars Appel <[log in to unmask]>
Reply To:
Lars Appel <[log in to unmask]>
Date:
Sat, 6 Sep 1997 01:01:30 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
At 11:57 01.09.1997 -0400, you wrote:
>Now I just have to figure out what we are doing that does not correctly
>allow the subprogram that is called to read the database name, described
>as EXTERNAL, only when the subprograms are in an XL. I understood that
>GLOBAL was not allowed; time to crack the books and scan the LaserROM on
>EXTERNAL, et al. Of course, if anyone would care to provide me with some
>direction, it would be most welcome.

There is a little gotcha with EXTERNAL variables and code modules in XL
libraries... NMPRG as well as (one or more) XL modules can/do have "static"
variables that are independent of each other (read: allocated completely
different memory addresses).

For example, you main program and subroutines may both use/declare some
variable named MYVAR. If you link all into one module (NMPRG) then there
will be only one MYVAR used by all routines. If you place some routines
into a separate XL module, there will be a second (independent) MYVAR in
that XL module. Main program won't access XL's MYVAR and vice versa.

(Well known problem with errno variable in C, has some tricks to solve).

As of MPE/iX 5.0 (or some later Express release; sorry, forgot details; see
Communicator article for more information if desired) there is an enhancement
implemented that is called "Shared Globals".

If you compile/link with the appropriate options the loader will be able to
match variables of NMPRG and XL modules by name and assign only one memory
location i.e. then MYVAR of NMPRG and MYVAR of XL module would be one very
variable. (The respective compile/link options are NOT the default).

Hope this helps.

Lars "MPE/iX Communicator is recommended reading" Appel ;-)

ATOM RSS1 RSS2