Simple calculator

Share your macros, knowledge, solutions, services, ...
Post Reply
Petr
Posts: 106
Joined: Tue Oct 18, 2016 1:12 pm

Simple calculator

Post by Petr » Fri Nov 25, 2016 1:01 pm

This is an example of a simple calculator.

Code: Select all

<#> Start of the macro
<cmds>

<#> Define input field for math expression 
<form_item>("f1","Math. Expression:","EDIT","","vExpression")

<#> Define text label under input field - example 
<form_item>("f1","Example: 1+(3/2-3.212)^2","TEXT","","")

<#> Program label "Show" 
<label>("Show")

<#> Show form with input field 
<form_show>("f1","Mathematical Expression Calculator","shell32.dll",12)

<#> Esc or Cancel pressed - then exit macro
<if_str>("_vCanceled == 1") <exitmacro> <endif>

<#> Calculate entered expression 
<var_oper>(vResult,"%vExpression%",CALC_EXPRESSION,"4","", "0")

<#> Show result 
<msg>(-100,-100,"vResult","Result:",1)

<#> Go to program label "Show" 
<goto>("Show")

<#> End of the macro


Post Reply