1.2 Device and Frame

 

To draw a graphic, you will first need a device such as a display or printer. The process of preparing the device is called "open" a device, and to "close" the device means to end the graphic processing. All graphics must be drawn between this "open" and "close" process. In the DCL, a single device can be opened at one time. Two or more devices cannot be opened simultaneously, but it is possible to select one device from several while open.

The graphics drawn on the device may extend over several pages. In the DCL, the term "frames" are used instead of the pages. This is because the concept of pages do not exists on some devices (for example, in devices that with outputs on long sheets like scrolls), or there are cases where several frames are allotted to a single physical page, as explained in a later section, and a frame needs to be distinguished from a physical page.

Programs that use graphics follow the flow below.


  CALL SGOPN(1)           ! Open device number 1

  CALL SGFRM              ! Prepare frame

  . . . . . . . .          ! Graphics program for the first page

  CALL SGFRM              ! New page

  . . . . . . . .          ! Graphics program for second page    

      . 

      . 

      . 

  CALL SGCLS              ! Close device