(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_lib, prev: GET_ACCNAM_BY_CONTEXT, next: GET_COMMON)


GET_COMMAND - Get Line from SYS$COMMAND


Format:
    data_from_command, resultant_length = \
        vms_lib.get_command ([prompt] [,buffer_length])
Returns:
data_from_command
String that LIB$GET_COMMAND gets from SYS$COMMAND.
resultant_length
Length of 'data_from_command'.
Arguments:
prompt
Prompt message to be displayed. Optional.
buffer_length
This argument is optional, default=65535.
By specifying buffer_length you can limit the input that LIB$GET_COMMAND accepts. If string truncation occured, then 'resultant_length' is negative to indicate this! This behaviour is different than LIB$GET_COMMAND.
Examples:
>>> import vms_lib

>>> # (text that is entered is either in italics or underlined)
>>> vms_lib.get_command ()
input-text<RETURN>
('input-text', 10)
>>> vms_lib.get_command (None,5)
input2-text2<RETURN>
('input', -5)
>>> vms_lib.get_command ('Yes?')
Yes?3input-3text<RETURN>
('3input-3text', 12)
>>> vms_lib.get_command ('Yes?',7)
Yes?4input-4text<RETURN>
('4input-', -7)

>>> vms_lib.get_command ('INPUT> ',None)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: illegal argument type for built-in operation
>>>

(go to: table of contents, index, list of vms_lib, prev: GET_ACCNAM_BY_CONTEXT, next: GET_COMMON)

30-SEP-1998 ZE.