// // FLOATDEMO-R.VDM Ch. Ziemski 04.01.2003 // 11.01.2003 // Demo for FLOATMATH-R.VDM // (with some tries of rounding ...) Reg_Empty(20) Reg_Set(21, "4") Reg_Empty(22) Reg_Empty(23) repeat(ALL){ #104 = Dialog_Input_1(20,"`Float Math Demo`, `Here you can try out the macro routines of FLOATMATH-R.VDM.`, `Allowed formulas are: [-]number1 + | - | * | / [-]number2`, `But attention: there is no error handling! Only for testing!`, `??Simple formula: `, `??Max. precision on division (max. 8): `, ` `, `??Result (int, evaluated via the builtin Num_Eval() ): `, `??Result (float, calculated by FLOATMATH-R.VDM): `, `[&Calculate]`,`[&Quit]`",SET+APP+CENTER,0,0) if(#104==0 || #104==2){ break } #21=Num_Eval_Reg(21) #21=Min(#21, 8) // max 8 allowed Num_Str(#21, 21, LEFT+NOCR) #22=Num_Eval_Reg(20) Num_Str(#22, 22, LEFT+NOCR) #103=Num_Eval_Reg(21) Reg_Set(103, @20) // copy formula into parameter register Call_File(101, "FLOATMATH-R.VDM") Reg_Set(23, @103) // copy result into register for displaying }