// // FLOATDEMO.VDM Ch. Ziemski 04.01.2003 // 11.01.2003 // Demo for FLOATMATH.VDM // 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.VDM.`, `Allowed formulas are: [-]number1 + | - | * | / [-]number2`, `But attention: there is no error handling! Only for testing!`, `??Simple formula: `, `??Precision on division (no rounding!): `, ` `, `??Result (int, evaluated via the builtin Num_Eval() ): `, `??Result (float, calculated by FLOATMATH.VDM): `, `[&Ok]`,`[Cancel]`",SET+APP+CENTER,0,0) if(#104==0 || #104==2){ break } #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.VDM") Reg_Set(23, @103) // copy result into register for displaying }