Hi Everyone,
I'm encountering an issue that suggests re-loading the RXLVM library is not successful, while several other REXX library are going through exactly the same process and are NOT showing this issue.
Please take a look at the below samples of my code and tell me where things may be going wrong?
1) load the REXX library
...
/* check if the RxLvm - RXLVM.DLL - is already loaded */
rxlvm_api = RxFuncQuery('RxLvmLoadFuncs')
msg_text = "RXLVM: API LOAD RC="||rxlvm_api
CALL debug debug_flag calling_code msg_level msg_text
If rxlvm_api <> 0 Then do
Call RxFuncAdd 'RxLvmLoadFuncs', 'RXLVM', 'RxLvmLoadFuncs'
Call RxLvmLoadFuncs
end
msg_text = "RXLVM: Using version "||RxLvmVersion()
CALL debug debug_flag calling_code msg_level msg_text
...
2) unload the REXX library
...
/* check the RXLVM library */
If rxlvm_api <> 0 Then
Call RxLvmDropFuncs
...
I use the rxlvm_api variable to tell me whether I need to un-load the library when my code is done. The purpose is to avoid doing so if the library was already loaded prior to my code starting, presumably something else out there loaded it first and perhaps requires it to remain loaded.
Now, 1st time through running my script I'm getting rxlvm_api=1, which means I did not have the RXLVM library loaded already and therefore need to load it. OK, good stuff, it works and the version info call (RxLvmVersion) works fine. The program then ends and the RXLVM is completely un-loaded.
However, re-running this script in the very same CLI session the 2nd time around produces the following error:
[G:\code\source\rexx\os2utils]nas_check v:
DEBUG : MAIN => Initializing...
DEBUG : ==> library_load => Initializing...
DEBUG : ==> library_load => RXU: Using version v1.a
DEBUG : ==> library_load => REXXUTIL: Using version 2.00
DEBUG : ==> library_load => RXUTILEX: Using version 0.1.6
DEBUG : ==> library_load => RXEXTRAS: API LOAD RC=0
DEBUG : ==> library_load => RXEXTRAS: Using version 1.G
DEBUG : ==> library_load => RXLVM: API LOAD RC=0
242 +++ msg_text = 'RXLVM: Using version ' || RxLvmVersion();
REX0043: Error 43 running G:\code\source\rexx\os2utils\nas_check.cmd, line
242: Routine not found
67 +++ Call library_load;
What's weird about this is that rxlvm_api is clearly set to 0, which implies that it's already loaded and perhaps the un-load call actually failed?
Either way, if it was already loaded, why does the call to RxLvmVersion fail?
BTW: the same process is repeated for several other libraries, they work fine.