MODULE port_test9_gm2; FROM IOChan IMPORT ChanId; FROM StdChans IMPORT StdOutChan; FROM Strings IMPORT Delete, Length; FROM TextIO IMPORT WriteLn, WriteString; FROM WholeIO IMPORT WriteCard; VAR str_a: ARRAY[0..0] OF CHAR; str_b: ARRAY[0..1] OF CHAR; str_c: ARRAY[0..2] OF CHAR; PROCEDURE TestDelete(the_str: ARRAY OF CHAR); VAR cid_out: ChanId; BEGIN (* PROCEDURE TestDelete *) cid_out:=StdOutChan(); WriteString(cid_out, '---------------begin new test ----------------'); WriteLn(cid_out); WriteString(cid_out, 'Length(the_str): '); WriteCard(cid_out, Length(the_str), 1); WriteLn(cid_out); WriteString(cid_out, 'HIGH(the_str): '); WriteCard(cid_out, HIGH(the_str), 1); WriteLn(cid_out); WriteString(cid_out, 'the_str: '); WriteString(cid_out, the_str); WriteLn(cid_out); WriteLn(cid_out); Delete(the_str, 0, 1); WriteString(cid_out, '"Delete(the_str, 0, 1)": '); WriteLn(cid_out); WriteLn(cid_out); WriteString(cid_out, 'Length(the_str): '); WriteCard(cid_out, Length(the_str), 1); WriteLn(cid_out); WriteString(cid_out, 'HIGH(the_str): '); WriteCard(cid_out, HIGH(the_str), 1); WriteLn(cid_out); WriteString(cid_out, 'the_str: '); WriteString(cid_out, the_str); WriteLn(cid_out); WriteLn(cid_out); WriteLn(cid_out); END TestDelete; BEGIN (* MODULE port_test9_gm2 *) TestDelete('1'); TestDelete('12'); TestDelete('123'); str_a:='a'; TestDelete(str_a); str_b:='ab'; TestDelete(str_b); str_c:='abc'; TestDelete(str_c); str_c:='d'; TestDelete(str_c); END port_test9_gm2. (* 09.05.2023 Small Test for Delete from Strings. *)