shared

avoid SHARED on {variable|temp-table|buffer} name

Rule "shared" gives this warning when it finds a "DEFINE" statement that contains a SHARE phrase (like SHARED, NEW SHARED, NEW GLOBAL SHARED).

Shared objects are generally considered as "not done", especially in a non-modal application since procedures may be run in random order and in multiple instances.
In general it is much better to avoid SHARED objects and replace them by parameters, or have those objects stored in persistent procedures and maintained by its internal procedures.

exceptions:

  1. shared streams are allowed, because they cannot easily be replaced by parameters and because you can't get a handle to a stream object.
  2. NEW GLOBAL SHARED procedure-handles are allowed, for the purpose of running persistent super-procedures (or so-called libraries like windows.p).

    Well, to be honest, the rule can't tell if a handle is really a procedure-handle, so
    it actually allows all new global shared handles.

the risc:

Confusion and bugs when multiple instances of the procedure are running.

how to solve this:

If it's just a simple variable replace it by parameters.

If it's a more complex object like a temp-table, store it in a persistent procedure (perhaps a super-procedure) and have it maintained by
internal procedures in that 'super', or create the object where you would normally define it as NEW SHARED and access it by its object-handle where you would normally define the SHARED object.

How to suppress these warnings:

You can put directive {&_proparse_ prolint-nowarn(shared)} directly before
the DEFINE keyword.
See also: suppress warnings.