Reads data from the area.
string
i5_data_area_read (string
name, [, int offset, int length] [, resource
connection])
Parameters
name |
Name of the data area.
|
Offset |
Offset for the data. |
Length |
Length of the data to read, -1 means whole area. |
Connection |
Connection – result of i5_connect |
If not offset is specified, all the area is read.
Return
String data if read successful, false if read failed (including when offset is wrong).
I5_ERR_PHP_HDLDFT |
256 |
No default connection found. |
I5_ERR_PHP_HDLCONN |
257 |
This resource has no connection active. |
I5_ERR_PHP_RESOURCE_BAD |
261 |
No resource found. |
I5_ERR_PHP_TYPEPARAM |
262 |
Type of element x in parameter -1 must be y. Type z was provided. |
I5_ERR_PHP_NBPARAM_BAD |
263 |
Wrong parameter count |
I5_ERR_PHP_DATAREA_READ |
296 |
The command returned an error: x. |
I5_ERR_PHP_EMPTY_NAME |
314 |
Object name can not be empty |
I5_ERR_PHP_BAD_DTAARA_LENGTH |
315 |
Data area x should be from -1 to -2 |
Example
$ret = i5_data_area_create ("QTEMP/MYDTA" , 50);
if (!$ret) trigger_error("i5_data_area_create error : ".i5_errormsg(), E_USER_ERROR);
$ret = i5_data_area_write ("QTEMP/MYDTA" , "MSG:Hello Word");
if (!$ret) trigger_error("i5_data_area_write error : ".i5_errormsg(), E_USER_ERROR);
$ret = i5_data_area_read ("QTEMP/MYDTA", 1, 4);
if (!$ret) trigger_error("i5_data_area_read error : ".i5_errormsg(), E_USER_ERROR);
echo "Type data: $ret<BR>" ;
$ret = i5_data_area_read ("QTEMP/MYDTA");
if (!$ret) trigger_error("i5_data_area_read error : ".i5_errormsg(), E_USER_ERROR);
echo "Message: $ret<BR>";
$ret = i5_data_area_delete ("QTEMP/MYDTA");
if (!$ret) trigger_error("i5_data_area_delete error : ".i5_errormsg(), E_USER_ERROR);