-- $Source: /commtar/monoBANK/CICS_INTF/io_tst.ada,v $ -- $Revision: 1.6 $ $Date: 88/03/23 15:58:49 $ $Author: chris $ with Host_Character_Pkg; with Direct_IO; with RTS_CICS_Exceptions; with CICS_Terminal_Control; procedure io_tst is package HC renames Host_Character_Pkg; package TC renames CICS_Terminal_Control; type status is (passed, failed); stat : status; type str_rec is record text : HC.Host_String(1..6); end record; package rec_io is new direct_io(str_rec); Queue : Rec_IO.File_Type; Rec1 : str_rec := (text=>HC.To_Host_String("first ")); Rec1in : str_rec; Rec2 : str_rec := (text=>HC.To_Host_String("second")); Rec2in : str_rec; Rec6 : str_rec := (text=>HC.To_Host_String("sixth ")); Rec6in : str_rec; begin Rec_IO.Open(Queue, Rec_IO.Inout_File, "TSQ1"); Rec_IO.Write(Queue, Rec1, 1); -- write element at index 1 Rec_IO.Write(Queue, Rec2, 2); -- write next element Rec_IO.Write(Queue, Rec6, 6); -- write element at index 6 Rec_IO.Read(Queue, Rec1in, 1); Rec_IO.Read(Queue, Rec2in); Rec_IO.Read(Queue, Rec6in, 6); if HC.To_String(Rec1in.text) = "first " and then HC.To_String(Rec2in.text) = "second" and then HC.To_String(Rec6in.text) = "sixth " then stat := passed; else stat := failed; end if; if Integer(Rec_IO.Size(Queue)) /= 6 then stat := failed; end if; Rec_IO.Set_Index(Queue, 3); if Integer(Rec_IO.Index(Queue)) /= 3 then Stat := failed; end if; Rec_IO.Close(Queue); if Rec_IO.Is_Open(Queue) then stat := failed; end if; case stat is when passed => TC.Send_Text("Test passed"); when failed => TC.Send_Text("Test failed"); end case; exception when RTS_CICS_Exceptions.QIDERR => TC.Send_Text("got a queue id error"); when others=> TC.Send_Text("got an unhandled exception"); end io_tst;