These lines process WingetActive to return valid folders. Normally I use Directory Opus and its window title is always the logged folder.
if strindexnc(Root, 'powerdesk', 0, @fwdscan)==1
Ndx = strindex(Root, '>', 0, @fwdscan)
Root = strsub(Root, Ndx+2, -1)
Ndx = strindex(Root, '\', 0, @backscan)
Root = strsub(Root, 1, Ndx)
else
Root = strcat(wingetactive(), '\')
endif
As for error handling this is my error handling template.
intcontrol(73, 2, 0, 0, 0) ; GOSUB error handler.
:WBERRORHANDLER
Error = LastError()
; if Error==####
; ; Deal with it.
; intcontrol(73, 2, 0, 0, 0) ; GOSUB error handler.
; return
; endif
ErrInfo = strcat('Error: #', Error, ': ', wberrortextstring, @crlf, 'Script: ', wberrorhandlerline, @crlf, 'Assignment: ', wberrorhandlerassignment, @crlf, 'File: ', wberrorhandlerfile, @crlf, 'Procedure: ', wberrorinsegment, @crlf, 'Line No. ', wberrorhandlerlinenumber, @crlf)
clipput(ErrInfo)
pause('Error Message on Clipboard', ErrInfo)
exit
And what I'm looking for is the code that I could insert here:
if Error==1028
; Deal with it.
...
intcontrol(73, 2, 0, 0, 0) ; GOSUB error handler.
return
endif
to recover from the error.