Rad Posted February 11, 2006 Posted February 11, 2006 $w = Number(1+2+10) ;returns 13 $x = Number("3.14") ;returns 3.14 $y = Number("24/7") ;returns 24 $z = Number("tmp3") ;returns 0 umm, right... I'm making a basic calculator for a demonstration for my friend. But what the hell?! If you press + it sets "$method[$currentmethod]" to +. Now, it has to be a "+" or else I get a syntax error. Now when I put $value[1] & $method[1] & $value[2] etc together it turns the mass into a string, then returns the first value. If I display the equation its all fine, but doesnt seem to work for as an equation... Is there any functionst to solve? Maybe I overlooked I checked the helpfile theres none like Equation() or Solve()...:/
Moderators SmOke_N Posted February 11, 2006 Moderators Posted February 11, 2006 $test = Number(24/7) $test2 = Int(24/7) MsgBox(0, 'test', "If you don't have it in a string you get this: (" & $test & ")" & @CRLF & "Or you could simply make it an integer like this Int(24/7) if you don't want decimals (" & $test2 & ")") Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Rad Posted February 11, 2006 Author Posted February 11, 2006 (edited) Hmm, that doesnt quite help because it makes it a string as I add every 'method' (+, -, *, /) to the equation... And it takes the first number/int if its a string (Another word for 'number' is real idk why it does have a real() function ;P) Edited February 11, 2006 by Rad
Moderators SmOke_N Posted February 11, 2006 Moderators Posted February 11, 2006 (edited) Can you provide a real code... what your actually doing? What returns a 'literal string'? Edit: You'll need beta for this:$test = Execute("24/7") MsgBox(0, 'test', "(" & $test & ")") Edited February 11, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Rad Posted February 12, 2006 Author Posted February 12, 2006 Ah thanks, that works great! Exactly what I needed, sorry I didnt come back for awhile my comp had a loading OS problem (which fixed itself?)... but yea, it works! Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now