Is there a command to List attached files? (Using 2018B)
I am using ExtractAttachedFiles and getting an error on one file. I double-checked the .cmp file and the file-in-question is listed there, and the "Count" under [Other Files] is accurate, but the script is crashing when asked to extract the file.
If there was such a command then I could "test" if the file is in the executable before attempting to extract.
Thanks!
Since the function only generates minor errors it is simple enough to wrap in a simple error handler.
nMode = ErrorMode(@OFF)
LastError()
ExtractAttachedFile('whatever','whatever')
ErrorMode(nMode)
if LastError()
;;; do something
endif
But it would seem better to just correct whatever is that is causing the file to either not be present or at least appear not to be present in the executable.
For future readers...
It's part of the ExtractAttachedFiles command - just call it with the correct params: empty quotes for the first param, and the second parameter is an integer representing which type of files to list.
Code example:
_EAF1 = ExtractAttachedFile(``, 1) ;EXTENDER DLLs
_EAF2 = ExtractAttachedFile(``, 2) ;OTHER FILES
filePut(`c:\EAF_Extdrs.txt`, _EAF1)
filePut(`c:\EAF_Other.txt`, _EAF2)
For future reads, it's in the Consolidated Help File and online documentation:
https://docs.winbatch.com/mergedProjects/WinBatch/WINBATCH_E__003.htm (https://docs.winbatch.com/mergedProjects/WinBatch/WINBATCH_E__003.htm)