Re: AutoDebug Re: calculator

Simon Jaeger <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <002701c7a3bd$2cb0f710$6500a8c0@lifebook>
oh, thanks. I forgot about that function:)

  ----- Original Message ----- 
  From: valery_vi 
  To: [email protected] 
  Sent: Wednesday, May 30, 2007 9:55 PM
  Subject: [AutoIt] AutoDebug Re: calculator


  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]
  >



   

[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.