Opens a Program or Procedure and prepares it to be run.
resource i5_program_prepare (string name[, array description] [, resource connection])
Parameters
name |
Program name.
To call a Procedure within a Service Program, the procedure name is given in parentheses, e.g., Lib/Service_Program(PROC)
|
description |
PHP-format program description. This should be provided if the program is not described on server. See: PHP Data Description
|
connection |
Result of i5_connect
|
Return
Resource if open succeeded, false if open failed.
I5_ERR_DESC_WRONG_DATAOP |
41 |
Wrong operation on a data field of a description |
I5_ERR_PARSEXML |
42 |
Internal error; please contact Aura Equipements. error number 42 |
I5_ERR_PHP_OPTIONSTYPE |
259 |
The type of " I5_OPTIONS_ALIAS" option must be x and not x |
I5_ERR_PHP_OPTIONSNUMBER |
260 |
Option number -1 is unknown. |
I5_ERR_PHP_TYPEPARAM |
262 |
Type of element x in parameter -1 must be y. Type z was provided. |
I5_ERR_PHP_ALREADY_PGMNAME |
284 |
You cannot call this function; because it was already called, or x was called. |
I5_ERR_PHP_PRIVATE_CONNECTION_NOT_FOUND |
285 |
the -1 connection has not been found. |
I5_ERR_PHP_GET_SYSVAL |
297 |
The command returned an error: x. |
I5_ERR_PHP_BAD_DS_INPUT |
308 |
Values for 'Data Structure' parametre -1 does not match the description. |
Examples
$description = array (
array ("Name"=>"OP1", "IO"=>I5_IN, "Type"=>I5_TYPE_PACKED, "Length"=>"5.2"),
array ("Name"=>"STR1", "IO"=>I5_IN, "Type"=>I5_TYPE_CHAR, "Length"=>20),
array ("Name"=>"OP2", "IO"=>I5_INOUT, "Type"=>I5_TYPE_PACKED, "Length"=>"5.2"),
array ("Name"=>"STR2", "IO"=>I5_INOUT, "Type"=>I5_TYPE_CHAR, "Length"=>30),
array ("Name"=>"OP3", "IO"=>I5_OUT, "Type"=>I5_TYPE_PACKED, "Length"=>"10.4")
);
$hdlPgm = i5_program_prepare("EASYCOMXMP/RPCSAMPLE", $description);
if (is_bool ( $hdlPgm ) && $hdlPgm == FALSE)
{
print_r("i5_program_prepare error : ".i5_errormsg().'<br/>');
}