OSI/FTAM Programming Guide

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Guide528612-001
5-78
Writing a File: TAL Programming Example
1402 ! and ends the program. Additional application-specific !
1403 ! error handling or recovery could be implemented if !
1404 ! required by an application. !
1405 ! !
1406 !--------------------------------------------------------------------!
1407
1408 PROC check_diag;
1409
1410 BEGIN
1411
1412 INT i; ! index into diagnostic array !
1413
1414 !-----------------------------------------------------------------!
1415 ! Display the number of diagnostic messages received. !
1416 !-----------------------------------------------------------------!
1417
1418 IF ( diag.zdiagcount > 0 ) THEN
1419 BEGIN
1420 tempbuf ':=' "Following is a list of " -> @text_ptr;
1421 text_len := @text_ptr - @tempbuf;
1422 width := DNUMOUT ( tempbuf[text_len]
1423 , $DBL ( diag.zdiagcount )
1424 , BASE );
1425 tempbuf[text_len + width] ':=' " diagnostic elements -" -> @text_ptr;
1426 text_len := @text_ptr - @tempbuf;
1427 CALL WRITE ( termnum, outbuf, text_len );
1428 END;
1429
1430 !-----------------------------------------------------------------!
1431 ! Display the diagnostic message type and error ID for each !
1432 ! diagnostic message. !
1433 !-----------------------------------------------------------------!
1434
1435 FOR i := 0 TO diag.zdiagcount-1 DO
1436 BEGIN
1437 tempbuf ':=' " Diagnostic Type: " -> @text_ptr;
1438 text_len := @text_ptr - @tempbuf;
1439 width := DNUMOUT ( tempbuf[text_len]
1440 , $DBL ( diag.zdiagelems[i].zdiagtype )