sundar Posted September 13, 2011 Share Posted September 13, 2011 (edited) I am having an issue with executing function which are available in another file. Basically i have main script (file1) for GUI and another file (file 2) contain only functions (created by me). At the moment i have written three functions each will be executed while pressing buttons. Third function is not executing and dont know where i am making mistake. All three functions uses same variables, so i set all the variables as globle in file1. To test third function i included MsgBox after every line. Form the MsgBox out put i could see that there is no issue with variables but i am struck in this line $EXT_FILE = '7z.exe x' & " " & $ARCHIVE_FILE & " " & "-y -o" & $DESTINATION_FOLDER & " " & 'file.txt' & " " & "-r" RunWait($EXT_FILE, "", @SW_HIDE) 7z.exe is in script folder. If i provide variables $ARCHIVE_FILE & $DESTINATION_FOLDER directly and run file 2 then the function works with out an issue. Where am i making mistake? Edited September 13, 2011 by sundar Link to comment Share on other sites More sharing options...
JohnOne Posted September 13, 2011 Share Posted September 13, 2011 '7z.exe x' = Not '7zi.exe x' AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sundar Posted September 13, 2011 Author Share Posted September 13, 2011 '7z.exe x' = Not '7zi.exe x'Yup. That is typo error actual file name is 7z.exe. I tried to run the function inside first file but then also it does not produce any result. Link to comment Share on other sites More sharing options...
sundar Posted September 13, 2011 Author Share Posted September 13, 2011 To be more specific i have shown the (trouble) function code below. The variable $FILE is actually created by the main program. Func ADD () If FileExists ( $FILE ) Then $EXT = "C:\Temp\temp" DirCreate ( $EXT ) Local $EXT_FILE $EXT_FILE = '7z.exe x' & " " & $FILE & " " & "-y -o" & $EXT & " " & 'file.txt' & " " & "-r" RunWait($EXT_FILE, "", @SW_HIDE) If FileExists ( $EXT & "\folder\file.txt" ) Then $Len = FileRead ( $EXT & "folder\file.txt" ) StringRegExp ( $Len , "string to search", 2, " " ) If @error = 0 Then MsgBox(4096,"", "Correct file found") EndIf EndIf DirRemove ( $EXT ) EndIf EndFunc ; ==> ADD Link to comment Share on other sites More sharing options...
sundar Posted September 13, 2011 Author Share Posted September 13, 2011 Any help pls. I am not able to move ahead with out solving this issue. Link to comment Share on other sites More sharing options...
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