Hi everyone,
I have followed on from Tom Cone's backup routine. My script creates a back up zip file and places it into a designated folder named username.zip
The script runs fine if the user has two buttons, one to run the batch, then wait until the dos batch has finished, then button second button to continue.
I want to place the whole script on one button but my poser is pausing the script while the dos batch is running . I could do this with a timer, but not really the answer.
I could really use some help with WHILE .NOT. statement towards the end of the script that checks to see if the dummy file is present.
'Create a dummy text file and the final line of the dos batch file will delete this.
filename="C:Myfolderdummy.txt"
file_pointer=file.create(filename,FILE_RW_SHARED)
file_pointer.flush()
file_pointer.close()
If username="Your name here".OR.username="" then
ui_msg_box("You must","enter your name before proceeding")
END
ELSE
sys_shell("Zipper.pif",1) ' dos batch file deletes previous.zip files if any, creates a zipfile Roomlist.zip
'and finally deletes dummy.txt file
END IF
'Check to see if dummy.txt exists, if false then I know batch has ended
filename="c:myfolderdummy.txt"
result = file.exists(filename)
trace.writeln(filename)
WHILE .NOT. Result=.f.
'THIS WHERE I AM STUCK
'I NEED XBASIC HERE TO NOT CONTINUE UNTIL RESULT IS FALSE
END WHILE
'this final part of the script must not continue until the batch has ended
filename=chr(92)+rtrim(remspecial(username))+".zip"
file_copy("c:myfolderroomlist.zip","c:myfolderchemdata"+filename)
oldfile="c:myfolderroomlist.zip"
file.remove(oldfile)
If I can get this right it will be a very useful script to share
Appreciate any help
Michael
I have followed on from Tom Cone's backup routine. My script creates a back up zip file and places it into a designated folder named username.zip
The script runs fine if the user has two buttons, one to run the batch, then wait until the dos batch has finished, then button second button to continue.
I want to place the whole script on one button but my poser is pausing the script while the dos batch is running . I could do this with a timer, but not really the answer.
I could really use some help with WHILE .NOT. statement towards the end of the script that checks to see if the dummy file is present.
'Create a dummy text file and the final line of the dos batch file will delete this.
filename="C:Myfolderdummy.txt"
file_pointer=file.create(filename,FILE_RW_SHARED)
file_pointer.flush()
file_pointer.close()
If username="Your name here".OR.username="" then
ui_msg_box("You must","enter your name before proceeding")
END
ELSE
sys_shell("Zipper.pif",1) ' dos batch file deletes previous.zip files if any, creates a zipfile Roomlist.zip
'and finally deletes dummy.txt file
END IF
'Check to see if dummy.txt exists, if false then I know batch has ended
filename="c:myfolderdummy.txt"
result = file.exists(filename)
trace.writeln(filename)
WHILE .NOT. Result=.f.
'THIS WHERE I AM STUCK
'I NEED XBASIC HERE TO NOT CONTINUE UNTIL RESULT IS FALSE
END WHILE
'this final part of the script must not continue until the batch has ended
filename=chr(92)+rtrim(remspecial(username))+".zip"
file_copy("c:myfolderroomlist.zip","c:myfolderchemdata"+filename)
oldfile="c:myfolderroomlist.zip"
file.remove(oldfile)
If I can get this right it will be a very useful script to share
Appreciate any help
Michael
Comment