//-------------------------------------------------------------------- // Example of the use of a function to return an array that is to be // passed to a procedure which expects a flexible array // main module FUNCT2FLX use TEXTIO // Functions which supply arrays function GET_STRING_2 () returns String : packed array [1..2] of char initially "AB" endfunction function GET_STRING_3 () returns String : packed array [1..3] of char initially "CDE" endfunction function GET_STRING_12 () returns String : packed array [1..12] of char initially "FGHIJKLMNOPQ" endfunction // Procedure which expects flexible arrays procedure TYPE_IT param String1: in ref packed array [1..?m] of char String2: in ref packed array [1..?n] of char String3: optional in ref packed array [1..?p] of char initially "............" endparam Out_string (TTY, String1 ) Out_string (TTY, String2 ) Out_string (TTY, String3 ) out_record (TTY) endprocedure TYPE_IT (GET_STRING_2(), GET_STRING_3(), GET_STRING_12() ) TYPE_IT (GET_STRING_2(), GET_STRING_3() ) endmodule