HPlogo MPE/iX Intrinsics Reference Manual > Chapter 7 Command Definitions (HP32208-HPLOACNMPROC)

HPCICOMMAND

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701
Edition 7 E0300 ♥
Edition 6 E0195

NM callable only.

Executes a command programmatically.

Syntax



               CA        I16       I16      I16V
  HPCICOMMAND (cmdimage, cmderror, parmnum, msglevel);

Parameters


cmdimage

character array (required)

Passes an ASCII string of <=279 characters consisting of a command and parameters, terminated by a carriage return. The carriage return character (%15) must be the last character of the command string. Do not include a prompt character in this string.

cmderror

16-bit signed integer by reference (required)

Returns any error code set by the last executed command. When the CI displays multiple errors for a single command, cmderr contains only the last error number displayed.

  • If cmderror is zero, no error occurred.

  • If cmderror is negative, a warning was detected.

This is the same error that would be returned by the command interpreter if cmdimage were executed interactively or in batch. The error message can be found in message set two of CATALOG.PUB.SYS.

Remote commands executed through the COMMAND or HPCICOMMAND intrinsics may not return a meaningful error status.

parmnum

16-bit signed integer by reference (optional)

Returns a number indicating the error:

  • If parmnum is positive, it is a file system error number and cmderror is non-zero.

  • If parmnum is negative, it is the column number where the error occurred and cmderror is non-zero. (The command interpreter (CI) prints a caret there.)

  • If parmnum is zero, then no additional error-related data is available.


NOTE: Check the cmderror parameter to verify if cmdimage succeeded. The parmnum may provide additional information.

msglevel

16-bit signed integer by value (optional)

Passes one of the following values, indicating how to handle error and warning messages:

Value

Meaning

0

All error/warning messages will be printed to $STDLIST (Default)

1

All CI error messages will be printed to $STDLIST; warning messages will be suppressed

2

No error/warning messages will be printed to $STDLIST.

If a value other than 0, 1, or 2 is specified, msglevel defaults to 0 and CIWARN 9007 (Invalid message level - expected 0, 1, 2) is sent to $STDLIST.

HPCICOMMAND prints a caret if the CI does, when given the same cmdimage parameter and msglevel<2.

Operation Notes


The HPCICOMMAND intrinsic allows the execution of UDCs and command files. RUN and other process creation commands are allowed if you or the program calling HPCICOMMAND have process handling (PH) capability.

The cmdimage parameter can contain any MPE/iX command except the following:

   ABORT      JOB
   BYE        LISTREDO
   CHGROUP    MOUNT
   DATA       MRJE
   DISMOUNT   NRJE
   DO         REDO
   EOD        RESUME
   EOJ        RJE
   EXIT       SETCATALOG
   HELLO      VSUSER

To control the error message display, use the msglevel parameter.

Related Information


Intrinsics

COMMAND

Manuals

Command Interpreter Access and Variables Programmer's Guide MPE/iX Commands Reference Manual




HPCALENDAR


HPCIDELETEVAR