PreviousNext
Help > API Functions > User spaces > i5_userspace_prepare
i5_userspace_prepare

 

Opens a user space and prepares it to be run.

 

resource i5_userspace_prepare (string name, array description [, resource connection])

Parameters

 

 

name

User space name in library/object format

description

PHP-format program description.

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' parameter -1 does not

match the description.

I5_ERR_PHP_EMPTY_NAME

314

Object name can not be empty

 

Example

 

 

$parameter = Array(

  "filler0"=>"AAAA",

  "generic"=>10,

  "filler"=>"BBB",

  "outputsize"=>100,

  "offsetInput"=> 0

 );

 $parmOut = array("filler0"=>"filler0", "filler"=>"filler", "generic"=>"generic", "outputsize"=>"outputsize", "offsetInput"=>"offsetInput");

 $UspcHdl = i5_userspace_prepare("qtemp/USERSPACE", $description);

 if (is_bool($UspcHdl)) trigger_error("i5_userspace_prepare error : ".i5_errormsg(), E_USER_ERROR);

 

 $ret = i5_userspace_put($UspcHdl, $parameter);

 if (!$ret) trigger_error("i5_userspace_put error : ".i5_errormsg(), E_USER_ERROR);

 

 $ret = i5_userspace_get($UspcHdl, $parmOut);

 if (!$ret){

  trigger_error("i5_userspace_get error : ".i5_errormsg(), E_USER_ERROR);

 } else {

  echo "Filler0 : ".$filler0."<BR>";

  echo "generic : ".$generic."<BR>";

  echo "filler : ".$filler."<BR>";

  echo "outputsize : ".$outputsize."<BR>";

  echo "offsetInput : ".$offsetInput."<BR>";  

 }
$ret = i5_userspace_close($UspcHdl);
if
(!$ret) trigger_error("i5_userspace_close error : ".i5_errormsg(), E_USER_ERROR);