You can add to the contents of an object, or to the contents of all of the objects in a class, by specifying an add to statement. The contents of an object are described by the drawing statements specified in the object definition.
When you specify an add to statement, ESL preserves all of the existing drawing statements for the object, and adds the new statements; for example:
response to EnterPassword
clear PasswordRegion
begin
response to char from keyboard
append input to Password
add to PasswordRegion
pattern Asterisk
response to PasswordDone
leave block
end
For graphical objects, the at position specification in an add to statement is equivalent to specifying a move to drawing statement as the first item in the contents to be added. If the at position specification is omitted, the new drawing statements begin at the current graphics cursor or text cursor position. For example:
response to SelectArea
add to SelectArea at position xcoord ycoord
pattern CrossHatch
is equivalent to:
response to SelectArea
add to SelectArea
move to xcoord ycoord
pattern CrossHatch
Since a textual region's drawing statements are distinct from graphical drawing statements, do not specify an add to statement for a class of objects that includes textual regions as well as graphical objects.
See Adding Drawing Statements to a Textual Region for information on how the add to statement affects textual regions.