Hi Jimmy
Currently from console I can control ErrorLevel without having to use .BAT , using this function...
FUNCTION ExtractZip ()
Local cCommand, nError, cMessage, cReturn
cCommand := "7ZA.exe x -y -bso0 -bsp0 -bse1 -...@EXCLUDE.LST MYFILE.ZIP -oX:\"+" > 7ZAINFO.LOG"
if SwpRunCmd(cCommand) == .f.
Alert('SwpRunCmd: Error Executing 7ZA for Extracting Data',{'Abort'})
cMessage := SwpRunCmd (.f.) Error Executing 7ZA for Extracting Data'
else
nError := SwpErrLev()
do case
case nError == 0 .or. nError = 1
cMessage := '' // No error or simple warnig
case nError == 2
cMessage := '7ZA (2) A fatal error occurred'
case nError == 3
cMessage := '7ZA (3) A CRC error occurred when unpacking'
case nError == 4
cMessage := '7ZA (4) Attempt to modify an archive previously locked'
case nError == 5
cMessage := '7ZA (5) Write to disk error'
case nError == 6
cMessage := '7ZA (6) Open file error'
case nError == 7
cMessage := '7ZA (7) Command line option error'
case nError == 8
cMessage := '7ZA (8) Not enough memory for operation'
case nError == 9
cMessage := '7ZA (9) Create file error'
case nError == 255
cMessage := '7ZA (255) User stopped the process'
otherwise
cMessage := '7ZA ('+AllTrim(Str(nError))+') Unknown Error'
endcase
endif
return(cMessage)
After the call, you can optionally display more details by displaying 7ZAINFO.LOG, but usually the first message is enough.
From the console I don't have any problem, since the execution of 7ZA is transparent to the user (nothing is shown on the screen).
I'm trying to advance the look of the application and have started with -gtwvt on some EXEs, thinking I might use GUI at some point (I don't really know when) so I'm looking into various possibilities.
In any case, I think that going back to using .BAT would be a step backwards, since it will be even more difficult to hide the call from other executables.
In that sense, I think Bernard has pointed in a more viable future direction by using -gtwvt or even -gtwvg.
By the way, what GUI flavor would you recommend to migrate from console?
(I have no experience coding GUI)
Best regards