//--------------------------------------------------------------------------- // test of parameter options //--------------------------------------------------------------------------- %define Diagnostics %define Store_Diagnostics %Set Diagnostics = false %set Store_Diagnostics = false main module PARAMETES use TEXTIO 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 PRINT_THEM param P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 : in val integer P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, P23, P24 : in val integer endparam out_integer (TTY, P1, "Nonop_IN_REF_NoInit =") out_integer (TTY, I1, "I1 = ") out_record (TTY) out_integer (TTY, P2, "Nonop_INOUT_REF_NoInit =") out_integer (TTY, I2, "I2 = ") out_record (TTY) out_integer (TTY, P3, "Nonop_OUT_REF_NoInit =") out_integer (TTY, I3, "I3 = ") out_record (TTY) //----------- out_integer (TTY, P4, "Nonop_IN_VAL_NoInit =") out_integer (TTY, I4, "I4 = ") out_record (TTY) out_integer (TTY, P5, "Nonop_INOUT_VAL_NoInit =") out_integer (TTY, I5, "I5 = ") out_record (TTY) out_integer (TTY, P6, "Nonop_OUT_VAL_NoInit =") //6 out_integer (TTY, I6, "I6 = ") out_record (TTY) //---------- out_string (TTY, "Nonop_IN_REF_Init =ILLEGAL") // 7 out_integer (TTY, I7, "I7 = ") out_record (TTY) out_string (TTY, "Nonop_INOUT_REF_Init =ILLEGAL") // 8 out_integer (TTY, I8, "I8 = ") out_record (TTY) out_integer (TTY, P9, "Nonop_OUT_REF_Init =") out_integer (TTY, I9, "I9 = ") out_record (TTY) //---------- out_string (TTY, "Nonop_IN_VAL_Init =ILLEGAL") // 10 out_integer (TTY, I10, "I10 = ") out_record (TTY) out_string (TTY, "Nonop_INOUT_VAL_Init =ILLEGAL") // 11 out_integer (TTY, I11, "I11 = ") out_record (TTY) out_integer (TTY, P12, "Nonop_OUT_VAL_Init =") out_integer (TTY, I12, "I12 = ") out_record (TTY) //----------Optionals--------------------------------- out_integer (TTY, P13, "Op_IN_REF_NoInit =") out_integer (TTY, I13, "I13 = ") out_record (TTY) out_integer (TTY, P14, "Op_INOUT_REF_NoInit =") out_integer (TTY, I14, "I14 = ") out_record (TTY) out_integer (TTY, P15, "Op_OUT_REF_NoInit =") out_integer (TTY, I15, "I15 = ") out_record (TTY) //----------- out_integer (TTY, P16, "Op_IN_VAL_NoInit =") out_integer (TTY, I16, "I16 = ") out_record (TTY) out_integer (TTY, P17, "Op_INOUT_VAL_NoInit =") out_integer (TTY, I17, "I17 = ") out_record (TTY) out_integer (TTY, P18, "Op_OUT_VAL_NoInit =") // 18 out_integer (TTY, I18, "I18 = ") out_record (TTY) //--------- out_integer (TTY, P19, "Op_IN_REF_Init =") out_integer (TTY, I19, "I19 = ") out_record (TTY) out_integer (TTY, P20, "Op_INOUT_REF_Init =") out_integer (TTY, I20, "I20 = ") out_record (TTY) out_integer (TTY, P21, "Op_OUT_REF_Init =") out_integer (TTY, I21, "I21 = ") out_record (TTY) //---------- out_integer (TTY, P22, "Op_IN_VAL_Init =") out_integer (TTY, I22, "I22 = ") out_record (TTY) out_integer (TTY, P23, "Op_INOUT_VAL_Init =") out_integer (TTY, I23, "I23 = ") out_record (TTY) out_integer (TTY, P24, "Op_OUT_VAL_Init =") out_integer (TTY, I24, "I24 = ") out_record (TTY) endprocedure procedure LEVEL_1 param Math_Flag : boolean //----------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 Nonop_OUT_VAL_NoInit : OUT VAL Integer //6 //---------- %if Diagnostics Nonop_IN_REF_Init : IN REF Integer initially -7 //7 Nonop_INOUT_REF_Init : INOUT REF Integer initially -8 //8 %endif Nonop_OUT_REF_Init : OUT REF Integer initially -9 //9 //---------- %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 Op_OUT_VAL_NoInit : Optional OUT VAL Integer //18 //--------- 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, 0, //-CANT READ Actual Parameter Nonop_IN_VAL_NoInit, Nonop_INOUT_VAL_NoInit, 0, //- CANT READ Actual Parameter 0, // Nonop_IN_REF_Init - ILLEGAL 0, // Nonop_INOUT_REF_Init - ILLEGAL 0, // //,- CANT READ Actual Parameter 0, // Nonop_IN_VAL_Init - ILLEGAL 0, // Nonop_INOUT_VAL_Init - ILLEGAL 0, //- CANT READ Actual Parameter //----------Optionals--------------------------------- Op_IN_REF_NoInit, Op_INOUT_REF_NoInit, 0, // - CANT READ //----------- Op_IN_VAL_NoInit, Op_INOUT_VAL_NoInit, 0, // - CANT READ //--------- Op_IN_REF_Init, Op_INOUT_REF_Init, 0, //- CANT READ //---------- Op_IN_VAL_Init, Op_INOUT_VAL_Init, 0) //- CANT READ //--- put new values into variables if Math_Flag do //----------Non optionals------------------------- %if Store_Diagnostics Nonop_IN_REF_NoInit *= +100 %endif Nonop_INOUT_REF_NoInit *= +100 Nonop_OUT_REF_NoInit := I3 +100 //----------- Nonop_IN_VAL_NoInit *= +100 Nonop_INOUT_VAL_NoInit *= +100 Nonop_OUT_VAL_NoInit := I3 +100 //---------- %if Diagnostics Nonop_IN_REF_Init *= +100 Nonop_INOUT_REF_Init *= +100 %endif Nonop_OUT_REF_Init := +100 //---------- %if Diagnostics Nonop_IN_VAL_Init *= +100 Nonop_INOUT_VAL_Init *= +100 %endif Nonop_OUT_VAL_Init := I12 + 100 //----------Optionals--------------------------------- %if Store_Diagnostics Op_IN_REF_NoInit *= +100 %endif Op_INOUT_REF_NoInit *= +100 Op_OUT_REF_NoInit := I15 +100 //----------- Op_IN_VAL_NoInit *= +100 Op_INOUT_VAL_NoInit *= +100 Op_OUT_VAL_NoInit := I18 +100 //--------- %if Store_Diagnostics Op_IN_REF_Init *= +100 %endif Op_INOUT_REF_Init *= +100 Op_OUT_REF_Init := I21 + 100 //---------- Op_IN_VAL_Init *= +100 Op_INOUT_VAL_Init *= +100 Op_OUT_VAL_Init := I24 +100 //---------- tty_line (" ") tty_line ("--WITHIN PROCEDURE ------ after adding 100 to out values:") PRINT_THEM ( Nonop_IN_REF_NoInit, Nonop_INOUT_REF_NoInit, 0, //-CANT READ Actual Parameter Nonop_IN_VAL_NoInit, Nonop_INOUT_VAL_NoInit, 0, //- CANT READ Actual Parameter 0, // Nonop_IN_REF_Init - ILLEGAL 0, // Nonop_INOUT_REF_Init - ILLEGAL 0, // //,- CANT READ Actual Parameter 0, // Nonop_IN_VAL_Init - ILLEGAL 0, // Nonop_INOUT_VAL_Init - ILLEGAL 0, //- CANT READ Actual Parameter //----------Optionals--------------------------------- Op_IN_REF_NoInit, Op_INOUT_REF_NoInit, 0, // - CANT READ //----------- Op_IN_VAL_NoInit, Op_INOUT_VAL_NoInit, 0, // - CANT READ //--------- Op_IN_REF_Init, Op_INOUT_REF_Init, 0, //- CANT READ //---------- Op_IN_VAL_Init, Op_INOUT_VAL_Init, 0) //- CANT READ endif endprocedure 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 SUPPLYING ALL OPTIONAL VALUES, DOING MATH------") RESET_VALUES () LEVEL_1 (true, 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) tty_line (" ") tty_line ("----- TEST WITHOUT SUPPLYING OPTIONAL VALUES ------") RESET_VALUES () LEVEL_1 (True, 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, NO MATH------") RESET_VALUES () LEVEL_1 (false, 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) tty_line (" ") tty_line ("----- TEST WITHOUT SUPPLYING OPTIONAL VALUES ------") RESET_VALUES () LEVEL_1 (false, 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) endmodule