(LOGO.JPG) Python for OpenVMS

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


LOAD_VIRTUAL_DISPLAY - Load a Virtual Display from a File

Create a new virtual display and loads it from a file that has been created from another virtual display saved with vms_smg.save_virtual_display().

Format:

    display_id = vms_smg.load_virtual_display ([filespec])
Returns:
display_id
Virtual display id that has been created.
Arguments:
filespec
The file specification of the file in which a virtual display was formerly saved. (The OpenVMS V6.1 documentation says 'is saved', which is wrong - the contents from this file are loaded by this routine).

If 'filespec' is omitted, the default file specification is SMGDISPLY.DAT. You must use OpenVMS format for the file specification.

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)
>>>

>>> # create a virtual display
>>> status, vtdpy1 = vms_smg.create_virtual_display \
...         (5, 10, vms_smgdef.SMG_M_BORDER, None, None)
>>>

>>> # paste the virtual display
>>> status = vms_smg.paste_virtual_display \
...          (vtdpy1, pasteboard_id, 3, 5, None)
>>>

>>> # put some text in the display
>>> status = vms_smg.put_chars (vtdpy1, 'Line1Line1Line1', 1, 1)
>>> status = vms_smg.put_chars (vtdpy1, 'Line2Line2Line2', 2, 2)
>>> status = vms_smg.put_chars (vtdpy1, 'Line3Line3Line3', 3, 3)
>>>

Screen layout, file: VMS_SMG_015.JPG

(picture VMS_SMG_015.JPG)

>>> # save contents to a file
>>> vms_smg.save_virtual_display (vtdpy1, 'SMG.TMP')
>>>
The result is a file with binary contents. You should not use the DCL command 'TYPE' to view its contents.
>>> # load these contents into a new virtual display
>>> vtdpy2 = vms_smg.load_virtual_display ('SMG.TMP')
>>>
>>> # paste the new display
>>> status = vms_smg.paste_virtual_display \
...          (vtdpy2, pasteboard_id, 7, 8, None)
>>>

Screen layout, file: VMS_SMG_054.JPG

(picture VMS_SMG_054.JPG)

>>> # try to save to an invalid filespec
>>> vms_smg.save_virtual_display (vtdpy1, 'BAD%@*.TMP')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_smg.error: (100052, '%RMS-F-SYN, file specification syntax error')
>>>

>>> # try to save a non-existent display id
>>> vms_smg.save_virtual_display (vtdpy1+99, 'SMG.TMP')
Traceback (innermost last):
  File "", line 1, in ?
vms_smg.error: (1212956, '%SMG-F-INVDIS_ID, invalid display-id')
>>>

>>> # try to load from an invalid filespec
>>> vtdpy = vms_smg.load_virtual_display ('BAD%@*.TMP')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_smg.error: (100052, '%RMS-F-SYN, file specification syntax error')
>>>

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

10-SEP-2000 ZE.