//------------------------------------------------------------------- // Test comparison of allocated flexible arrays with string constants //------------------------------------------------------------------- main module ALLOCATE7 use TEXTIO declare Flex_array is packed array [1..?n] of char P is pointer Flex_array T1, T2 : static P temp1 : static packed array[1..5] of char temp2 : static packed array[1..7] of char enddeclare T1 := allocate P ("ABCDE") T2 := allocate P ("ABCDE") temp1 := "ABCDE" temp2 := "ABCDEFG" out_string (tty, "(true): ") out_boolean (tty, t1@=t2@) out_string (tty, " (false): ") out_boolean (tty, t1@<>t2@) out_string (tty, " (true): ") out_boolean (tty, t1@=temp1) out_string (tty, " (false): ") out_boolean (tty, t1@<>temp1) out_record (tty) out_string (tty, "(false): ") out_boolean (tty, t1@=temp2) out_string (tty, " (true): ") out_boolean (tty, t1@<>temp2) out_record (tty) t1@ := "12345" out_string (tty, "(false): ") out_boolean (tty, t1@=t2@) out_string (tty, " (true): ") out_boolean (tty, t1@<>t2@) out_string (tty, " (false): ") out_boolean (tty, t1@=temp1) out_string (tty, " (true): ") out_boolean (tty, t1@<>temp1) out_record (tty) endmodule