1. Home
  2. SETDEVICE procedure

SETDEVICE procedure

Opens a graphical file and specifies the device number on basis of its extension (M.P. Boer & J.T.N.M. Thissen).

No options

Parameters

FILENAME = texts Name of the graphical file including one of the possible extensions .bmp, .emf, .eps, .gmf, .jpg, .jpeg, .pdf, .png, .tif or .tiff; must be set
NUMBER = scalars Saves the device number corresponding to the graphical format specified by parameter FILENAME
ACTION = string token How to create graphs for file types such as .emf, .jpg, .tif or .png (asynchronous, synchronous); default asyn

Description

SETDEVICE opens a graphical file and specifies the device number on the basis of the extension of the given filename. The table below shows the correspondence between extension and device number.

Extension

Device number

Explanation

.bmp

2

Bitmap

.pdf

4

Portable Document Format

.eps

5

Encapsulated PostScript file

.emf

6

Windows Enhanced Metafile

.jpg or .jpeg

7

JPEG file

.tif or .tiff

8

TIFF file

.png

9

Portable Network Graphics file

.gmf

10

Genstat Metafile

The ACTION parameter controls how graphs are created for the file types .emf, .jpg, .jpeg, .tif, .tiff, .png, .gmf and .bmp. The setting synchronous creates the graph before executing another command, whereas the setting asynchronous allows subsequent commands to be executed whilst the graph is created.

Options: none.

Parameters: FILENAME, NUMBER, ACTION.

See also

Directive: DEVICE.

Commands for: Graphics.

Example

CAPTION   'SETDEVICE example'; STYLE=meta
VARIATE   [VALUES=1,4,2,3] y
VARIATE   [VALUES=1...4] x
PEN       1; METHOD=line
DGRAPH    Y=y; X=x
SETDEVICE 'Example1.gmf'; NUMBER=Device
PRINT     Device; DECIMALS=0
DGRAPH    Y=y; X=x
CLOSE     CHANNEL=Device; FILETYPE=graph
SETDEVICE 'Example2.emf'; NUMBER=Device
PRINT     Device; DECIMALS=0
DGRAPH    Y=y; X=x
CLOSE     CHANNEL=Device; FILETYPE=graph
DEVICE    1
Updated on March 5, 2019

Was this article helpful?