MODULE port_test5b_gm2; FROM ChanConsts IMPORT OpenResults, old, raw, write; FROM IOChan IMPORT ChanId, RawWrite; FROM SYSTEM IMPORT ADR; IMPORT StreamFile; IMPORT SeqFile; PROCEDURE IoTest(); CONST arr_len= 16; TYPE arr_type= ARRAY[0..arr_len-1] OF CHAR; VAR cid_file: ChanId; file_name: arr_type; res: OpenResults; array: arr_type; c1: CARDINAL; BEGIN (* PROCEDURE IoTest *) file_name:='test_data'; (* initialize array for first write operation with upper case letters *) FOR c1:=0 TO arr_len-1 DO array[c1]:=CHR(65+c1); END; (* FOR c1 *) (* write arr_len characters to file *) StreamFile.Open(cid_file, file_name, write+old+raw, res); IF res=opened THEN RawWrite(cid_file, ADR(array), arr_len); StreamFile.Close(cid_file); END; (* IF res=opened *) (* initialize array for second write operation with lower case letters *) FOR c1:=0 TO arr_len-1 DO array[c1]:=CHR(65+32+c1); END; (* FOR c1 *) (* append (arr_len DIV 2) characters to file *) SeqFile.OpenAppend(cid_file, file_name, write+old+raw, res); (* SeqFile.OpenWrite(cid_file, file_name, write+old+raw, res); *) IF res=opened THEN RawWrite(cid_file, ADR(array), arr_len DIV 2); SeqFile.Close(cid_file); END; (* IF res=opened *) END IoTest; BEGIN (* MODULE port_test5b_gm2 *) IoTest(); END port_test5b_gm2. (* 16.04.2023 A few tests for GM2. *)