AutoDebug Re: calculator
"valery_vi" <[email protected]>
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <[email protected]> |
Solution is function Execute.
ie
Type '3456 + 6.89'
BTW Using it you can evaluate a content of any variable of AutoIt
script (auto debug!).
ie
Type '$test'
or
Type '$test & " is test line!"'
#NoTrayIcon
$test = 'Test line!'
$result=""
while 1
$input=inputbox("Calculator","enter equation:",$result)
if @error then exit
$result=execute($input)
Msgbox(0,'Result', $result)
wend
Valery
--- In [email protected], Simon Jaeger <simonjaeger@...>
wrote:
>
> 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]
>