(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_smg, prev: PREV, next: NEXT)


CREATE_PASTEBOARD - Create a Pasteboard

Create a pasteboard and returns its assigned pasteboard identifier.

Format:

    status, pasteboard_id, number_of_pasteboard_rows, \
    number_of_pasteboard_columns, type_of_terminal, device_name \
        = vms_smg.create_pasteboard ([output_device], [flags])
Returns:
status
The condition value as returned by SMG$CREATE_PASTEBOARD. Any code other than SS$_NORMAL and SMG$_PASALREXI results in a Python exception.
pasteboard_id
The identifier of the newly created pasteboard.
number_of_pasteboard_rows
The number of rows on the device specified in the output_device argument.
number_of_pasteboard_columns
The number of columns on the device specified in the output_device argument.
type_of_terminal
The SMG$ internal device type to which the output associated with this pasteboard will be written. Constants like SMG_K_UNKNOWN are defined in module 'vms_smgdef'.
device_name
The device name of the device on which the output associated with this pasteboard is written. See the OpenVMS documentation for more details.
Arguments:
output_device
The file specification or logical name to which the output associated with this pasteboard will be written.
flags
Specifies the attributes to be used in the pasteboard.
Bitmask values like SMG_M_KEEP_CONTENTS are defined in module 'vms_smgdef'.
Examples:
>>> import vms_smg
>>> import vms_smgdef

>>> # create a new DECwindows terminal using SMG
>>> status,                       \
... pasteboard_id,                \
... number_of_pasteboard_rows,    \
... number_of_pasteboard_columns, \
... type_of_terminal,             \
... device_name                   \
... = vms_smg.create_pasteboard   \
...   (None, vms_smgdef.SMG_M_WORKSTATION)
>>>

Warning! If you re-execute this command another screen is created!

>>> print "status......................:", status
status......................: 1
>>> print "pasteboard_id...............:", pasteboard_id
pasteboard_id...............: 0
>>> print "number_of_pasteboard_rows...:", number_of_pasteboard_rows
number_of_pasteboard_rows...: 24
>>> print "number_of_pasteboard_columns:", number_of_pasteboard_columns
number_of_pasteboard_columns: 80
>>> print "type_of_terminal............:", type_of_terminal
type_of_terminal............: 6
>>> print "device_name.................:", device_name
device_name.................: _FTA20:
>>>

----------------------------------------

>>> # create a pasteboard in the current screen
>>> #  leaving off SMG_M_KEEP_CONTENTS will erase the screen
>>> status,                       \
... pasteboard_id,                \
... number_of_pasteboard_rows,    \
... number_of_pasteboard_columns, \
... type_of_terminal,             \
... device_name                   \
... = vms_smg.create_pasteboard   \
...   (None, vms_smgdef.SMG_M_KEEP_CONTENTS)
>>>
>>> print "status......................:", status
status......................: 1
>>> import vms_sys
>>> vms_sys.getmsg (status)
('%SYSTEM-S-NORMAL, normal successful completion', (0, 0, 0, 0))
>>> print "pasteboard_id...............:", pasteboard_id
pasteboard_id...............: 0
>>> print "number_of_pasteboard_rows...:", number_of_pasteboard_rows
number_of_pasteboard_rows...: 24
>>> print "number_of_pasteboard_columns:", number_of_pasteboard_columns
number_of_pasteboard_columns: 80
>>> print "type_of_terminal............:", type_of_terminal
type_of_terminal............: 6
>>> print "device_name.................:", device_name
device_name.................: SYS$OUTPUT
>>>

Note: if you re-execute this command a different status is returned:

>>> print "status......................:", status
status......................: 1212465
>>> import vms_sys
>>> vms_sys.getmsg (status)
('%SMG-S-PASALREXI, pasteboard already exists for this device',\
 (0, 0, 0, 0))
>>>

----------------------------------------

>>> # create a pasteboard on a file
>>> vms_smg.create_pasteboard ('FILENAME.TMP')
(1, 0, 66, 132, 0, 'FILENAME.TMP')
>>>

Note: if you re-execute this command another file is created:

$! this logical name defines the page size
$ DEFINE SYS$LP_LINES 72
[...]
>>> vms_smg.create_pasteboard ('FILENAME.TMP')
(1, 0, 72, 132, 0, 'FILENAME.TMP')
>>>

$ directory FILENAME.TMP

Directory DKA100:[PYTHON.PYTHON-1_5_2.VMS]

FILENAME.TMP;2      FILENAME.TMP;1

Total of 2 files.
$

see also vms_lib.lp_lines ()

----------------------------------------

>>> vms_smg.create_pasteboard ('*BADNAME*')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_smg.error: (100164, '%RMS-F-WLD, invalid wildcard operation')
>>>

>>> vms_smg.create_pasteboard (1)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 1: expected read-only buffer, int found
>>>

>>> vms_smg.create_pasteboard ('')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_smg.error: (1409644, '%LIB-F-BADBLOSIZ, bad block size')
>>>

>>> vms_smg.create_pasteboard (None, 'X')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 2: flags - must be integer or None
>>>

(go to: table of contents, index, list of vms_smg, prev: PREV, next: NEXT)

04-JUN-2000 ZE.