- Code: Select all
$person = array(
"name" => array(I5_TYPE_CHAR, 50),
"age" => array(I5_TYPE_INT, 0),
"ID" => array(I5_TYPE_BYTE, 10)
$data = array(
"person" => array(I5_TYPE_STRUCT, $person),
"last_accesses" => array(I5_TYPE_INT, 0, I5_OUT, 3),
"account_balance" => array(I5_TYPE_PACKED, "10.3", I5_OUT)
$prg = i5_program_prepare("MYLIB/PERSONPGM", $data);
I set up my parameters to match the RPG but the i5_program_prepare fails with the message that it is expecting a string parameter. If I change the I5_TYPE_STRUCT to a I5_TYPE_CHAR and set the length to match the length of the data structure parameter in the RPG, it runs without error. Trouble is, I get back a huge string of data that is difficult to use.
Has anyone successfully used the I5_TYPE_STRUCT parameter with RPG and would be willing to give me some pointers?