calculator

Simon Jaeger <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <006c01c7a32e$85d52530$6500a8c0@lifebook>
Hello, I am trying to craete a calculator in autoit that will automatically calculate whatever is typed into it...

#NoTrayIcon
$result=""
while 1
$input=inputbox("Calculator","enter equation:",$result)
if @error then exit
$result=eval($input)
wend

Really simple, but...
This works great until you type in 1+1 and it returns "1+1", rather than 2.

So my question is, does anyone know how I can make this easier than defining every last mathematical function? Can I not make it automatically perform whatever function I need it to perform, and return the appropriate result?


Simon


[Non-text portions of this message have been removed]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.