Dim oDialog1 AS Object Sub avaDialoog DialogLibraries.LoadLibrary("Standard") oDialog1 = CreateUnoDialog(DialogLibraries.Standard.arvutus) oDialog1.Execute() end sub sub vormiKorrutus oDialog1.getControl("NumericField3").value= _ oDialog1.getControl("NumericField1").value* _ oDialog1.getControl("NumericField2").value end sub sub vormiJagamine oDialog1.getControl("NumericField3").value= _ oDialog1.getControl("NumericField1").value/ _ oDialog1.getControl("NumericField2").value end sub sub vormiLiitmine oDialog1.getControl("NumericField3").value= _ oDialog1.getControl("NumericField1").value+ _ oDialog1.getControl("NumericField2").value end sub sub vormiLahutamine oDialog1.getControl("NumericField3").value= _ oDialog1.getControl("NumericField1").value- _ oDialog1.getControl("NumericField2").value end sub Dim oDialog2 AS Object dim sisestusvali as String Sub avaDialoog2 DialogLibraries.LoadLibrary("Standard") oDialog2 = CreateUnoDialog(DialogLibraries.Standard.kalkulaator) sisestusvali="NumericField1" oDialog2.Execute() end sub sub nupuVajutus(syndmus as Object) oDialog2.getControl(sisestusvali).value= _ oDialog2.getControl(sisestusvali).value*10+ _ int(syndmus.source.model.label) end sub sub tehteVajutus(syndmus as Object) sisestusvali="NumericField2" oDialog2.getControl("Label1").text= _ syndmus.source.model.label end sub sub arvutaTulemus arv1=oDialog2.getControl("NumericField1").value arv2=oDialog2.getControl("NumericField2").value tehe=oDialog2.getControl("Label1").text if tehe="+" then tulemus=arv1+arv2 end if if tehe="-" then tulemus=arv1-arv2 end if if tehe="x" then tulemus=arv1*arv2 end if if tehe="/" then tulemus=arv1/arv2 end if oDialog2.getControl("NumericField3").value=tulemus end sub