Script functions reference > Message traversing functions > Message traversing examples

Message traversing examples
Example 44
The script in this example browses a frame and retrieves the values of the field "ManualRow_Type" from all blocks within the frame.
$handle=MsgFrameOpen("", 0);
$returnValue=MsgNextBlock($handle);
//Get value from sub-block and check if correct blockname from XML
$block_name=MsgBlockId($handle);
if($block_name="Order_Manuell_row")
{
//Get number of fields in Order_Manuell_row block and initiate counter.
$NoOfblockFields=MsgNumFields($handle);
$NoOfBlockFields_I=1;
//find field "ManualRow_Type" and extract value
while (num($NoOfBlockFields_I)<=num($NoOfBlockFields))
{
$field_id=MsgFieldId($handle, $NoOfBlockFields_I);
if($field_id="ManualRow_type")
{
//Get value from field "ManualRow_type"
$Type_value=MsgFieldValue($handle, $NoOfBlockFields_I);
}
$NoOfBlockFields_I++;
}
}
//Check that the same block is examined
while(num($returnValue)!=0 and $block_name!="Order_Row")
{
//Return value if next OrderRow or all OrderRows examined=0
$returnValue=MsgNextBlock($handle);
//Get value from sub-block and check if correct block name from XML
$block_name=MsgBlockID($handle);
if($block_name="Order_Manuell_row")
{
//Get number of fields in Order_Manuell_row block and initiate counter.
$NoOfblockFields=MsgNumFields($handle);
$NoOfBlockFields_I=1;
//find field "ManualRow_Type" and extract value
while (num($NoOfBlockFields_I)<=num($NoOfBlockFields))
{
$field_id=MsgFieldId($handle, $NoOfBlockFields_I);
if($field_id="ManualRow_type")
{
//Get value from field "ManualRow_type"
$Type_value=MsgFieldValue($handle, $NoOfBlockFields_I);
}
$NoOfBlockFields_I++;
}
}
}
 
OpenText StreamServe 5.6 Updated: 2013-03-01