PreviousNext
Help > Easycom .NET > Easycom namespace > EasycomConnection > EasycomConnection.RemoteCommand Method
EasycomConnection.RemoteCommand Method

 Executes a native command.

 

Class EasycomConnection

 

Syntax

public void RemoteCommand(String strCommand)

Description

 

EasycomConnection.RemoteCommand executes a command for the current connection. This command can affect the environment (JOB) of the current connection. For example, a command can run a program that will change the library list, the objects overrides, and so on.

An exception (EasycomException) will be thrown if the command failed (command syntax, or execution failure …).

The command syntax is like AS/400 terminal command line (best is to test the command syntax in the terminal before using it in the method).

 

Restrictions: this method cannot call interactive commands (like DSPMSG). This method cannot call commands that require return variables: use the RemoteRtvCommand instead.

 

Example (VB.NET):

Try

mycnx.RemoteCommand("ADDLIBLE MYLIB")

mycnx.RemoteCommand('CHGDTAARA DTAARA(*LDA (1 2)) VALUE(AA)');

Catch except As Exception

MessageBox.Show("Error while executing command : " + except.Message, Me.Text)

End Try

 

Example (C#):

try

      {

            mycnx.RemoteCommand("ADDLIBLE MYLIB");

mycnx.RemoteCommand("'CHGDTAARA DTAARA(*LDA (1 2)) VALUE(AA)");

      }

catch (EasycomException exp)

{

MessageBox.Show("Error while executing command : "+ exp.Message);

     }