Please enable JavaScript to view this site.

ESL Documentation

The xsize of and ysize of functions can be applied to all regions, dialog boxes and dialog control objects. When applied to a graphical object, the values returned are the X and Y dimensions of the specified graphical region's viewport.

 

In the following example, the user wants to move graphical region Chapter to the right by a given amount called StepSize. Before moving, the program checks to be sure that the position is such that Chapter can be moved without going off the right edge of the screen. To make this check, the program considers both the current position of Chapter (which marks its left edge) and its width. Note that (xposition + xsize) is the right edge.

 

response to MoveRight    # User selects right arrow

    if ((xposition of Chapter + xsize of Chapter)

        <= (ScreenWidth - StepSize)) then

        change Chapter position by StepSize 0

    end if