Sign in to follow this  
Followers 0
sundar

Main script not executing function (function) from other file

5 posts in this topic

#1 ·  Posted (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 by sundar

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Any help pls. I am not able to move ahead with out solving this issue.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0