## ‘.. Delta property

Any APL array or overlay

Valid for: All objects

Any property name which starts with the delta character ‘ can be used to store your own data in the object. Subject to available memory, you can have as many such properties as you like, and you can store any simple or nested array, or overlay, in the property. Referencing a delta property to which no data has been assigned generates a VALUE ERROR, just like a standard APL variable:

          W„'Œ' ŒNEW 'Window'
          W.‘TYPE„'SCATTER'
          W.‘VALS„13.4 66.7 12.2
          W.‘TYPE
    SCATTER
          W.‘VALS
    13.4 66.7 12.2
          W.‘XPOS
    VALUE ERROR
          W.‘XPOS
          ^

#### Using Delta properties to share data between tasks

Delta properties work in a special way for APL (child task) objects. A delta property for the System object of a child task is the same as the delta property of the same name in the parent task’s APL (child task) object. Thus the parent task can assign arbitrary data to a delta property, and the child task can access it through its own System object. If the child task writes to a delta property of its System object, the parent can see the data which has been assigned in the child task object:

          Task1„'Œ' ŒNEW 'APL' ª  Task1.wssize„200000  ª   Task1.background„1
          Task1.‘MESSAGE„'Startup'
          Task1.Open
          Task1.Execute "'#' ŒWI '‘MESSAGE' 'OK'"
          Task1.‘MESSAGE
    OK

This feature can be used in a number of ways. When starting a task, it can be used to pass an overlay containing all the functions and variables which the child task will need to run. When the task is running, delta properties can be used to share state information, parameters and results between the parent and the child.

The `delta` property persists for as long as the child task object exists in the parent task. This means that a child task can write to a `delta` property, and then terminate. The data will still be available to the parent.

### Special considerations for Client-Server versions of APLX

Because the whole System Class sub-system runs on the Client machine, the data contained in a `delta` property is held (in memory) on the Client machine, as a variable in APLX 32-bit format (even if the APL session which wrote the variable is a 64-bit implementation of APLX). The data must therefore be representable as a 32-bit object, which means it must be smaller than 2GB and must not contain more than 2147483647 elements. An array which contains 64-bit integer numbers of magnitude bigger than 2*31 will be converted to float data, and precision may be lost.

Topic: APLX Help : System Classes : Properties : ‘.. (delta property)

[ Previous | Contents | Index ]