Feature #12196
LOAD without BASE-KEY: OpenEdge search order and errors
0%
History
#1 Updated by Greg Shah 7 days ago
Problem¶
LOAD environment [DIR directory] [BASE-KEY {key | "INI"}] [NEW] makes a registry key or an initialization file available to USE, GET-KEY-VALUE and PUT-KEY-VALUE. Applications commonly read their own .ini file with no BASE-KEY:
LOAD "myapp" DIR cIniDir NO-ERROR. USE "myapp". GET-KEY-VALUE SECTION "Printers" KEY "Default" VALUE cPrinter. UNLOAD "myapp".
In OpenEdge on Windows, a LOAD without BASE-KEY looks for the environment in the registry under HKEY_CURRENT_USER first and, if it is not there, loads myapp.ini from the DIR directory (or from the standard search locations when DIR is omitted). The code above therefore reads the .ini file. When neither exists and NEW is not given, LOAD raises an error.
FWD currently handles a LOAD without BASE-KEY as a registry key under HKEY_CURRENT_USER on a Windows client, and as FWD's registry-like store on any other client. The .ini file is never consulted, and the LOAD always succeeds. Every GET-KEY-VALUE then returns the unknown value, and PUT-KEY-VALUE stores values somewhere other than the .ini file, with no error.
Work¶
- On a Windows client, follow the OpenEdge order: the registry key under
HKEY_CURRENT_USERfirst, thenenvironment.iniin theDIRdirectory, or in the standard search locations whenDIRis omitted. - On any other client, load
environment.inifrom theDIRdirectory or the search locations if it exists, and otherwise use FWD's registry-like store as today. - When the environment is not found and
NEWis not given, raise the OpenEdge error ("The LOAD of ... failed", or theDIRform of that message, with the same error numbers), so thatNO-ERRORandERROR-STATUS:ERRORbehave as in OpenEdge. Check whatLOAD ... NEWcreates in each case. - Check the standard search locations OpenEdge uses for an
.inifile whenDIRis omitted, and use the same order (with the server's or client's path mapping applied). - Check
UNLOAD,USEandUSE ""after each kind ofLOAD, and thatPUT-KEY-VALUEwrites to the file that was loaded. - Update the gap marking for
LOAD.
Testcases¶
On Windows OpenEdge first, then FWD on a Windows and a Linux client:LOADwithDIRand noBASE-KEY, where only the.inifile exists; where only the registry key exists; where both exist; where neither exists, with and withoutNEWandNO-ERROR.- The same with
DIRomitted. GET-KEY-VALUEandPUT-KEY-VALUEafter each, and the file contents afterPUT-KEY-VALUE.ERROR-STATUS:ERROR,NUM-MESSAGESand the message text for the failing cases.