OACOMMAND
oacommand executes an operating system command on the server from within
an Omnidex application.
Unlike other OmniAccess routines, oacommand can be called without being
connected to an environment by passing a null or zero through the instance
parameter.
When executing a system command through oacommand, control is returned
to the calling application when the system returns control to the command
interpreter.
For example, if a directory command is executed through oacommand, control
is returned to the OmniAccess application only after the directory listing
has been returned. If a batch process is submitted through oacommand,
control is returned to the OmniAccess application after the batch process
has been initiated, even though the batch process is still running.
Syntax
oacommand (instance, options, status, node, input,
input_length,
output,
output_length)
instance -- Instance identifies
a unique connection to a catalog previously established by
oaconnect. This is a 32-bit signed integer passed by value.
Instance can be null when executing a command on the local
server.
options -- Options determines
how the command will be passed. This is a character value
passed by reference, with a maximum length of 256 bytes, including
a semicolon or null terminator. The valid options values are:
status -- Indicates the success
or failure of the oacommand routine. A zero in status word
1 means a successful call to oacommand. The status structure
is passed by reference and contains fourteen 32-bit signed
integers, followed by a 36 character buffer.
node -- Is reserved when oacommand is
used in a host application and must contain only a semicolon or null terminator.
However, when a client application calls oacommand, node must contain
the host name as declared in the Client Data Source file (terminated by
a semicolon or null). In both cases, oacommand executes the command on
the server.
input -- Input is a character
value, passed by reference, and terminated with a semicolon
or null character. It specifies the command to be run.
The length of the command you pass in the input parameter
depends on the maximum length allowed by the operating system.
input_length -- Input_length
is a 32-bit integer, passed by value, that specifies the length
in bytes of the input parameter.
output -- Output is reserved
for future use. Must contain a null or a semicolon passed
by reference.
output_length -- Output_length is reserved
for future use. Must contain 32 null bits passed by value.
Options
NULLTERM - indicates that input is null
terminated.
SEMITERM - indicates that input is semicolon
terminated.
PRINT_OUTPUT - prints the output to the
screen.
The default is un-terminated input.
Example
Top
|