update global functions at runtime

Started by Thomas Bock, August 04, 2023, 05:56:43 AM

Previous topic - Next topic

Thomas Bock

Each time we update global functions on a Windows system they don't work any more. PxPlus throws many types of errors depending on how the functions have changed. Here is what we do in order to update/reload the global functions:


bkpPC = prm('PC')
set_param 'PC' = 0
! do update actions
set_param 'PC' = bkpPC
drop pth("globalFunctions.pvx"), err = *next
call "globalFunctions.pvx" ! addr itself


What needs to be done for a successful update?

James Zukowski

At a prior job, we occasionally updated the global functions, as well. If I recall, we PERFORMed the program with the functions. Whenever we set the functions, we also set a couple of global variables to the program's creation date/time, so we only reset them if the program was updated.

There was no need to DROP or ADDR, as PxPlus dealt with that automatically. The new versions of the functions would take effect immediately upon return to the caller.

Caveat: We were using Linux, not Windows, for our server. I don't think it should make a difference, though. Then again, it's Windows...
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services