[SDL Forum Society - Logo] Tutorial on SDL-88
Belina, Hogrefe (edits Reed)

Imported and exported value

Back Home Up

In SDL a variable is visible only within a process in which it has been created. If another process wants to access the value of the variable, then a signal interchange with the process owning the variable is needed. By using the imported and exported value shorthand, the user of SDL can specify this in a much simpler way.

The exporter (the process that owns the variable) defines the exported variable as follows:

DCL EXPORTED sum Integer;

where sum is the name of the exported variable, having the predefined sort Integer. The exporter controls the disclosure of the value of the exported variable by performing the task

wpe4.gif (2461 bytes)

which causes the current value of sum to be stored in an implicit copy of that variable. This implicit copy is then used when answering an import request.

The importing process makes the following import definition

IMORTED sum Integer;

where the name and the son must be the same as for the exported variable. When the import expression

IMPORT (sum, exporterid)

for example in the following task

wpe6.gif (2353 bytes)

is executed in the importer, the value stored in the implicit copy of the exported sum will replace the import expression. The expression exporterid having the sort Pld gives the address of the exporter (it can be omitted if no other process can export variables having the same name and sort).

Back Home Up

Contact the webmaster with questions or comments about this web site.
Copyright © 1997-May, 2013 SDL Forum Society