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

3.2 Variables

Back Home Up Next

At the beginning of this section it was indicated that a process may locally use and manipulate data stored in variables. These are defined, in a text symbol.

wpe8.gif (2459 bytes)

Figure 11: Definition of a variable
(in a text symbol from an SDL-88 diagram).

The text symbol is an important additional symbol for process diagrams (and other diagrams such as block diagrams), to include in these diagrams items (such as variable definitions) that are expressed as text. Other examples are signal definitions and comment in figure 6 and figure 7.

The keyword DCL introduces definition of one or more variables in a text box. Optionally, the variable may be initialised when it is created at interpretation time to a certain value. In the example of figure 11, the variable Counter is initialised to the value 0. When there is more than one variable defined after DCL these are separated by commas. The definition list is ended by the semicolon.

wpe9.gif (2425 bytes)

Figure 12: Manipulation of the variable
(in a transition fragment of an SDL-88 process diagram).

During a transition the process can use and manipulate its own local variables, using the task construct. A task construct is always an assignment. In SDL/GR the task construct is represented by a task symbol, which is a rectangle, as shown in the example of figure 12 containing "Counter:=Counter+1".

The task symbol is an important addition to the set of symbols for defining the state machine of a process. The additional of data manipulation to the transitions effectively extends the concept of finite state machines.

Back Home Up Next

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