Click or drag to resize

LinkarCltRunSubroutine_Text Method (CredentialsOptions, String, Int32, String, DATAFORMAT_TYPE, String, Int32)

Executes a subroutine, in a Synchronous way.
Direct Method.

Namespace:  LinkarClient
Assemblies:   LinkarClientCore (in LinkarClientCore.dll) Version: 2.1.0.0
  LinkarClientMono (in LinkarClientMono.dll) Version: 2.1.0.0 (2.1.0.0)
  LinkarClient (in LinkarClient.dll) Version: 2.1.0.0 (2.1.0.0)
Syntax
public static string RunSubroutine_Text(
	CredentialsOptions credentialsOptions,
	string subroutineName,
	int argsNumber,
	string arguments,
	DATAFORMAT_TYPE outputStringType = DATAFORMAT_TYPE.MV,
	string customVars = "",
	int receiveTimeout = 0
)

Parameters

credentialsOptions
Type: LinkarCommonCredentialsOptions
Object that defines the necessary data to access to the Linkar Server: Username, Password, EntryPoint, Language, FreeText.
subroutineName
Type: SystemString
Subroutine name you want to execute.
argsNumber
Type: SystemInt32
Number of arguments that the subroutine accepts.
arguments
Type: SystemString
The subroutine arguments list separated by the DC4 (20) character, the number of elements in the list must coincide with the number of arguments.
outputStringType (Optional)
Type: LinkarCommonDATAFORMAT_TYPE
Indicates in what format you want to receive the data resulting from the operation: MV, XML or JSON.
customVars (Optional)
Type: SystemString
It's a free text that will travel until the database to make the admin being able to manage additional behaviours in the standard routine SUB.LK.MAIN.CONTROL.CUSTOM. This routine will be called if the argument has content.
receiveTimeout (Optional)
Type: SystemInt32
It's the maximum time in seconds that the client will keep waiting the answer by the server. By default -1 (wait indefinitely).

Return Value

Type: String
Returns an object of type LkString with the results of the operation.
Exceptions
ExceptionCondition
SocketException

Thrown when there are communication problems between LINKAR Client and LINKAR Server

LkException

Thrown when there are errors in LINKAR Client or LINKAR Server

Examples
CredentialsOptions crdOpt = new CredentialsOptions("127.0.0.1", 11300, "admin", "admin", "ENTRYPOINT");

string subroutineName = "SUB.DEMOLINKAR";
int argsNumber = 3;
string[] lstArgs = new string[] { "0", "qwerty", "" };
string arguments = DataFunctions.GetLstArgsForLkString(lstArgs);
DATAFORMAT_TYPE outputStringType = DATAFORMAT_TYPE.MV;
string result = LinkarClt.RunSubroutine_Text(crdOpt, subroutineName, argsNumber, arguments, outputStringType);
See Also