Project

General

Profile

Feature #12196

LOAD without BASE-KEY: OpenEdge search order and errors

Added by Greg Shah 7 days ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

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

  1. On a Windows client, follow the OpenEdge order: the registry key under HKEY_CURRENT_USER first, then environment.ini in the DIR directory, or in the standard search locations when DIR is omitted.
  2. On any other client, load environment.ini from the DIR directory or the search locations if it exists, and otherwise use FWD's registry-like store as today.
  3. When the environment is not found and NEW is not given, raise the OpenEdge error ("The LOAD of ... failed", or the DIR form of that message, with the same error numbers), so that NO-ERROR and ERROR-STATUS:ERROR behave as in OpenEdge. Check what LOAD ... NEW creates in each case.
  4. Check the standard search locations OpenEdge uses for an .ini file when DIR is omitted, and use the same order (with the server's or client's path mapping applied).
  5. Check UNLOAD, USE and USE "" after each kind of LOAD, and that PUT-KEY-VALUE writes to the file that was loaded.
  6. Update the gap marking for LOAD.

Testcases

On Windows OpenEdge first, then FWD on a Windows and a Linux client:
  • LOAD with DIR and no BASE-KEY, where only the .ini file exists; where only the registry key exists; where both exist; where neither exists, with and without NEW and NO-ERROR.
  • The same with DIR omitted.
  • GET-KEY-VALUE and PUT-KEY-VALUE after each, and the file contents after PUT-KEY-VALUE.
  • ERROR-STATUS:ERROR, NUM-MESSAGES and the message text for the failing cases.

Also available in: Atom PDF