//--------------------------------------------------------------------------- // test of parameter options //--------------------------------------------------------------------------- %set Optional_none_initially_OK = true %define Diagnostics %define Store_Diagnostics %Set Diagnostics = false %set Store_Diagnostics = false main module PARAMETES use TEXTIO procedure PRINT_THEM param I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12 : in val integer I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, I24 : in val integer endparam out_integer (TTY, I1, "Nonop_IN_REF_NoInit =") out_record (TTY) out_integer (TTY, I2, "Nonop_INOUT_REF_NoInit =") out_record (TTY) out_integer (TTY, I3, "Nonop_OUT_REF_NoInit =") out_record (TTY) //----------- out_integer (TTY, I4, "Nonop_IN_VAL_NoInit =") out_record (TTY) out_integer (TTY, I5, "Nonop_INOUT_VAL_NoInit =") out_record (TTY) out_string (TTY, "Nonop_OUT_VAL_NoInit =ILLEGAL 6") //6 out_record (TTY) //---------- out_string (TTY, "Nonop_IN_REF_Init =ILLEGAL 7") // 7 out_record (TTY) out_string (TTY, "Nonop_INOUT_REF_Init =ILLEGAL 8") // 8 out_record (TTY) out_string (TTY, "Nonop_OUT_REF_Init =ILLEGAL 9") out_record (TTY) //---------- out_string (TTY, "Nonop_IN_VAL_Init =ILLEGAL 10") // 10 out_record (TTY) out_string (TTY, "Nonop_INOUT_VAL_Init =ILLEGAL 11") // 11 out_record (TTY) out_integer (TTY, I12, "Nonop_OUT_VAL_Init =") out_record (TTY) //----------Optionals--------------------------------- out_integer (TTY, I13, "Op_IN_REF_NoInit =") out_record (TTY) out_integer (TTY, I14, "Op_INOUT_REF_NoInit =") out_record (TTY) out_integer (TTY, I15, "Op_OUT_REF_NoInit =") out_record (TTY) //----------- out_integer (TTY, I16, "Op_IN_VAL_NoInit =") out_record (TTY) out_integer (TTY, I17, "Op_INOUT_VAL_NoInit =") out_record (TTY) out_string (TTY, "Op_OUT_VAL_NoInit =ILLEGAL 18") // 18 out_record (TTY) //--------- out_integer (TTY, I19, "Op_IN_REF_Init =") out_record (TTY) out_integer (TTY, I20, "Op_INOUT_REF_Init =") out_record (TTY) out_integer (TTY, I21, "Op_OUT_REF_Init =") out_record (TTY) //---------- out_integer (TTY, I22, "Op_IN_VAL_Init =") out_record (TTY) out_integer (TTY, I23, "Op_INOUT_VAL_Init =") out_record (TTY) out_integer (TTY, I24, "Op_OUT_VAL_Init =") out_record (TTY) endprocedure procedure LEVEL_1 param //----------Non optionals------------------------- Nonop_IN_REF_NoInit : IN REF Integer //1 Nonop_INOUT_REF_NoInit : INOUT REF Integer //2 Nonop_OUT_REF_NoInit : OUT REF Integer //3 //----------- Nonop_IN_VAL_NoInit : IN VAL Integer //4 Nonop_INOUT_VAL_NoInit : INOUT VAL Integer //5 %if Diagnostics Nonop_OUT_VAL_NoInit : OUT VAL Integer //6 %endif //---------- %if Diagnostics Nonop_IN_REF_Init : IN REF Integer initially -7 //7 Nonop_INOUT_REF_Init : INOUT REF Integer initially -8 //8 Nonop_OUT_REF_Init : OUT REF Integer initially -9 //9 %endif //---------- %if Diagnostics Nonop_IN_VAL_Init : IN VAL Integer initially -10 //10 Nonop_INOUT_VAL_Init : INOUT VAL Integer initially -11 //11 %endif Nonop_OUT_VAL_Init : OUT VAL Integer initially -12 //12 //----------Optionals--------------------------------- Op_IN_REF_NoInit : Optional IN REF Integer //13 Op_INOUT_REF_NoInit : Optional INOUT REF Integer //14 Op_OUT_REF_NoInit : Optional OUT REF Integer //15 //----------- Op_IN_VAL_NoInit : Optional IN VAL Integer //16 Op_INOUT_VAL_NoInit : Optional INOUT VAL Integer //17 %if Diagnostics Op_OUT_VAL_NoInit : Optional OUT VAL Integer //18 %endif //--------- Op_IN_REF_Init : Optional IN REF Integer initially -19 Op_INOUT_REF_Init : Optional INOUT REF Integer initially -20 Op_OUT_REF_Init : Optional OUT REF Integer initially -21 //---------- Op_IN_VAL_Init : Optional IN VAL Integer initially -22 Op_INOUT_VAL_Init : Optional INOUT VAL Integer initially -23 Op_OUT_VAL_Init : Optional OUT VAL Integer initially -24 //---------- endparam tty_line (" ") tty_line ("--------At start of procedure: (initial conditions are -)") PRINT_THEM ( Nonop_IN_REF_NoInit, Nonop_INOUT_REF_NoInit, Nonop_OUT_REF_NoInit, Nonop_IN_VAL_NoInit, Nonop_INOUT_VAL_NoInit, 0, // Nonop_OUT_VAL_NoInit 0, // Nonop_IN_REF_Init 0, // Nonop_INOUT_REF_Init 0, // Nonop_OUT_REF_Init, 0, // Nonop_IN_VAL_Init 0, // Nonop_INOUT_VAL_Init Nonop_OUT_VAL_Init, //----------Optionals--------------------------------- Op_IN_REF_NoInit, Op_INOUT_REF_NoInit, Op_OUT_REF_NoInit, //----------- Op_IN_VAL_NoInit, Op_INOUT_VAL_NoInit, 0, // Op_OUT_VAL_NoInit //--------- Op_IN_REF_Init, Op_INOUT_REF_Init, Op_OUT_REF_Init, //---------- Op_IN_VAL_Init, Op_INOUT_VAL_Init, Op_OUT_VAL_Init) //--- put new values into variables //----------Non optionals------------------------- %if Store_Diagnostics Nonop_IN_REF_NoInit *= +100 %endif Nonop_INOUT_REF_NoInit *= +100 Nonop_OUT_REF_NoInit *= +100 //----------- Nonop_IN_VAL_NoInit *= +100 Nonop_INOUT_VAL_NoInit *= +100 %if Diagnostics Nonop_OUT_VAL_NoInit *= +100 %endif //---------- %if Diagnostics Nonop_IN_REF_Init *= +100 Nonop_INOUT_REF_Init *= +100 Nonop_OUT_REF_Init *= +100 %endif //---------- %if Diagnostics Nonop_IN_VAL_Init *= +100 Nonop_INOUT_VAL_Init *= +100 %endif Nonop_OUT_VAL_Init *= +100 //----------Optionals--------------------------------- %if Store_Diagnostics Op_IN_REF_NoInit *= +100 %endif Op_INOUT_REF_NoInit *= +100 Op_OUT_REF_NoInit *= +100 //----------- Op_IN_VAL_NoInit *= +100 Op_INOUT_VAL_NoInit *= +100 %if Diagnostics Op_OUT_VAL_NoInit *= +100 %endif //--------- %if Store_Diagnostics Op_IN_REF_Init *= +100 %endif Op_INOUT_REF_Init *= +100 Op_OUT_REF_Init *= +100 //---------- Op_IN_VAL_Init *= +100 Op_INOUT_VAL_Init *= +100 Op_OUT_VAL_Init *= +100 //---------- tty_line (" ") tty_line ("-------- after adding 100 to out values:") PRINT_THEM ( Nonop_IN_REF_NoInit, Nonop_INOUT_REF_NoInit, Nonop_OUT_REF_NoInit, Nonop_IN_VAL_NoInit, Nonop_INOUT_VAL_NoInit, 0, // Nonop_OUT_VAL_NoInit 0, // Nonop_IN_REF_Init 0, // Nonop_INOUT_REF_Init 0, // Nonop_OUT_REF_Init, 0, // Nonop_IN_VAL_Init 0, // Nonop_INOUT_VAL_Init Nonop_OUT_VAL_Init, //----------Optionals--------------------------------- Op_IN_REF_NoInit, Op_INOUT_REF_NoInit, Op_OUT_REF_NoInit, //----------- Op_IN_VAL_NoInit, Op_INOUT_VAL_NoInit, 0, // Op_OUT_VAL_NoInit //--------- Op_IN_REF_Init, Op_INOUT_REF_Init, Op_OUT_REF_Init, //---------- Op_IN_VAL_Init, Op_INOUT_VAL_Init, Op_OUT_VAL_Init) endprocedure declare I1 : static integer initially 1 I2 : static integer initially 2 I3 : static integer initially 3 I4 : static integer initially 4 I5 : static integer initially 5 I6 : static integer initially 6 I7 : static integer initially 7 I8 : static integer initially 8 I9 : static integer initially 9 I10 : static integer initially 10 I11 : static integer initially 11 I12 : static integer initially 12 I13 : static integer initially 13 I14 : static integer initially 14 I15 : static integer initially 15 I16 : static integer initially 16 I17 : static integer initially 17 I18 : static integer initially 18 I19 : static integer initially 19 I20 : static integer initially 20 I21 : static integer initially 21 I22 : static integer initially 22 I23 : static integer initially 23 I24 : static integer initially 24 enddeclare Procedure RESET_VALUES () I1 := 1 I2 := 2 I3 := 3 I4 := 4 I5 := 5 I6 := 6 I7 := 7 I8 := 8 I9 := 9 I10:= 10 I11:= 11 I12:= 12 I13:= 13 I14:= 14 I15:= 15 I16:= 16 I17:= 17 I18:= 18 I19:= 19 I20:= 20 I21:= 21 I22:= 22 I23:= 23 I24:= 24 endprocedure tty_line (" ") tty_line ("----- TEST WITHOUT SUPPLYING OPTIONAL VALUES ------") RESET_VALUES () LEVEL_1 (I1, I2, I3, I4, I5, //I6, I7, I8, // I9,I10, I11, I12) tty_line (" ") tty_line ("--------------After return from Procedure") PRINT_THEM ( I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, I24) tty_line (" ") tty_line ("----- TEST SUPPLYING ALL OPTIONAL VALUES ------") RESET_VALUES () LEVEL_1 (I1, I2, I3, I4, I5, //I6, I7, I8, // I9, I10, I11, I12, I13, I14, I15, I16, I17, //I18, I19, I20, I21, I22, I23, I24) tty_line (" ") tty_line ("--------------After return from Procedure") PRINT_THEM ( I1, I2, I3, I4, I5, I6, I7, I8, I9, I10, I11, I12, I13, I14, I15, I16, I17, I18, I19, I20, I21, I22, I23, I24) endmodule