![]() Lifetime of the Task Global Data Area |
![]() DEVELOPER |
![]() |
The TGDA is not persistent across executions of the same Task, even if the executions are requested by the same caller. Therefore, this area cannot be used to retain variables from the end of one execution of a Task to its next execution. A different programming technique, similar to that of cookies used by web browsers, should be used. Variables that need to be retained across different Task executions must be passed back as parameters to the caller by the Task that is just terminating, stored away by the calling application inside its data area, and passed in again as ‘Both’ parameters at the start of the next execution of the Task.
It is not possible to have a data element that is global to all executions of a particular Task, similar to a Class Static variable in C++.
Topic ID: 540083