piccaso Posted November 24, 2004 Posted November 24, 2004 AutoItParse would be neat FileInstalling autoit.exe to execute at runtime generated code kind of bloats it up... CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
layer Posted December 21, 2004 Posted December 21, 2004 hmmm, i was thinking of what newkreation said too... write what the user types into an ini file and then call it later... lemme see if this would work, later...because i got a concert to attend =/ (sry i know this post is old but, you know ) FootbaG
SlimShady Posted December 21, 2004 Posted December 21, 2004 hmmm, i was thinking of what newkreation said too... write what the user types into an ini file and then call it later... lemme see if this would work, later...because i got a concert to attend =/(sry i know this post is old but, you know )<{POST_SNAPBACK}>Ofcourse it won't work.I tested just now:INIWrite(@TempDir & "Test.tmp", "Calculation", "Test1", "5*3+15") $Calc = INIRead(@TempDir & "Test.tmp", "Calculation", "Test1", "") MsgBox(64, "Debug", "$Calc:" & @CRLF & $Calc)
layer Posted December 21, 2004 Posted December 21, 2004 hmmm, shouldn't there be a Number function in there? but here's what i thought INIWrite (@TempDir & "\test.ini\", "Prolem", "Numbers", "4/2") $calculation= INIRead (@TempDir & "\test.ini\", "Problem", "Numbers", "What problem?") $do= Number ($calculation) MsgBox (0, "test", $do) but even so, that returns 0 and is like the same thing as doing this: $math= GUIRead ($edit_23) $answer= Number ($math) GUICtrlSetData ($edit_23, "= ", 1) GUICtrlSetData ($edit_23, $answer, 1) inside the script... so i was wrong =( FootbaG
SlimShady Posted December 22, 2004 Posted December 22, 2004 hmmm, shouldn't there be a Number function in there?<{POST_SNAPBACK}>Seems like you didn't read my post...
SlimShady Posted December 22, 2004 Posted December 22, 2004 (edited) Found a way to do this! See here: ;Example: $RetValue = _Calc("5 * 5 * (5 + 25)") MsgBox(64, "Test _Calc", "$RetValue: " & $RetValue) Func _Calc($Expr) $TmpBatch = @TempDir & "\Calc.bat" If NOT FileExists($TmpBatch) Then CreateBatch($TmpBatch) $val = RunWait($TmpBatch & ' "' & $Expr & '"', "", @SW_HIDE) EndFunc Func CreateBatch($BatchFile) $OpenBatch = FileOpen($BatchFile, 2) FileWriteLine($OpenBatch, "SET /A VAL=%1") FileWriteLine($OpenBatch, "EXIT %VAL%") FileClose($OpenBatch) EndFunc Edited December 22, 2004 by SlimShady
ezzetabi Posted December 22, 2004 Author Posted December 22, 2004 It is just a variation of Valik's idea and it can't return non integers. Try ;Example: $RetValue = _Calc("5 * 5 * (5 + 25.1)") MsgBox(64, "Test _Calc", "$RetValue: " & $RetValue) Func _Calc($Expr) $TmpBatch = @TempDir & "\Calc.bat" If NOT FileExists($TmpBatch) Then CreateBatch($TmpBatch) $val = RunWait($TmpBatch & ' "' & $Expr & '"', "", @SW_HIDE) EndFunc Func CreateBatch($BatchFile) $OpenBatch = FileOpen($BatchFile, 2) FileWriteLine($OpenBatch, "SET /A VAL=%1") FileWriteLine($OpenBatch, "EXIT %VAL%") FileClose($OpenBatch) EndFunc
layer Posted December 22, 2004 Posted December 22, 2004 i was thinking of batch files... but youve done it, let me try it FootbaG
SumTingWong Posted December 22, 2004 Posted December 22, 2004 Have a look at my Reverse Polish Notation calculator UDF here
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