Macro Toolworks Products Discussion Forums :: Knowledge Base
Welcome Guest   
 Subject :square root.. 11-09-2011 22:09:00 
javierbalana@yahoo.es
Joined: 11-09-2011 19:56:12
Posts: 2
Location
hi
is it possible to calculate the square root of a number? I cant find the command ...
thank you
IP Logged
 Subject :Re:square root.. 12-09-2011 09:57:23 
petr
Joined: 15-10-2009 11:48:52
Posts: 152
Location
If you use Professional edition of the product then you can use VBA-like script that is integrated to do this. Square root is not part of the native macro language of standard product.
IP Logged
 Subject :Re:square root.. 12-09-2011 12:08:23 
javierbalana@yahoo.es
Joined: 11-09-2011 19:56:12
Posts: 2
Location
Unfortunately it is the just standard version.
Thanks anyway
IP Logged
 Subject :Re:square root.. 18-11-2011 02:23:21 
murraymd
Joined: 17-05-2010 03:31:48
Posts: 9
Location
<#> Square Root Calculator (Newton-Raphson Method)
<cmds>
<form_item>("FM1","This macro calculates square roots:","TEXT","0","")
<form_item>("FM1","","LINE","0","")
<form_item>("FM1","Enter a number:","EDIT","0","vOper1")
<form_item>("FM1","","LINE","0","")
<form_item>("FM1","Continue ?","CHECK","YES","vAgain")
<label>("lbl_Again")

<form_show>("FM1","Square Root Finder","calc.exe",0)
<if_str>("_vCanceled==1") <exitmacro> <endif>


<varset>("vNum=1","")

<if_num>("vOper1>0")
<begloop>(30)
<var_oper>(vNum,"(%vNum%+%vOper1%/%vNum%)/2",CALC_EXPRESSION,"4","", "0")
<endloop>
<endif>

<if_num>("vOper1==0")
<varset>("vNum=0","")
<endif>

<if_num>("vOper1<0")
<varset>("vNum=Please enter a positive number.","")
<endif>


<msg>(-100,-100,"%vNum%","The result is:",1,,0)
<if_str>("vAgain==YES")
<goto>("lbl_Again")
<endif>
IP Logged
Malcolm D. Murray
 Subject :Re:square root.. 24-11-2011 17:05:59 
petr
Joined: 15-10-2009 11:48:52
Posts: 152
Location
Hello Malcolm,

thanks for this nice post. The "sqrt" function will be added in next (standard) version.

Best regards,
Petr
IP Logged
Page # 


Powered by ccBoard


Login and share your experience - send messages to forums and add comments to samples, commands and other resources.



Account is free of charge, easy to setup.