Kbase 13886: SHARED variable definition errors with persistent procedures
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
SHARED variable definition errors with persistent procedures
A problem has been detected in Versions 7.3A and 7.3B with PERSISTENT
procedures and SHARED variables, worktables, or temptables. The
problem presents itself when a program has a NEW SHARED data
structure in a main procedure and uses it as SHARED in subprocedures.
Progress will present errors in the subprocedures complaining that
the shared structure has not yet been defined. It is not necessary
for every procedure in the application to be persistent: the problem
has been seen when only a portion of them are.
Programmers should *not* attempt to get around the problem by merely
defining the structure as NEW SHARED in the subprocedure, thus
satisfying the compiler.
The proper workaround is to make sure the shared structure is defined
in *all* procedures, regardless of whether it is actually used in all
of them. For instance, if you define a temptable NEW SHARED in the
main program and use it only in one subprocedure, you should still
define it as SHARED in all subprocedures.
In the case of shared VARIABLEs, it may be necessary not only to
include the SHARED definition, but to access the variable. For
example:
DEF SHARED VARIABLE myvar AS CHAR.
ASSIGN myvar = myvar.
The ASSIGN statement will not affect program behavior but will get
around the problem by forcing the compiler to "see" the variable.
PLEASE NOTE: In addition it should be noted that Progress Development
strongly recommends that shared variables NOT be used when designing
applications with persistent procedures. Instead, they recommend
that passed parameters be used. This is due to the fact that shared
variables adversely affect the modularity of the procedures. PROGRESS
Version 8 will incorporate persistent procedures as a basic strategy
in object-oriented programming. Users who implement persistent
procedures with passed parameters instead of shared variables will
better be able to work within the tenets of the new Application
Development Model.
Progress Software Technical Support Note # 13886