Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: IntControl 73 Not Capturing Error Handling 3048 error substitution variable not followed by percent %
Also, any ideas for trapping an error such as the below? (Yes, I know it's a syntax error that simply needs to be corrected by the developer, but I still would like to trap for stuff like this if it slips through to production.) Intcontrol(73,1,@true,0,0) TestString = strclean("abcdefg","%","",@false,1);3048 error substitution variable not followed by percent exit :WBERRORHANDLER Error=LastError() ErrorMessage=strcat("Error: ",Error,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandlerline: ",wberrorhandlerline,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandleroffset: ",wberrorhandleroffset,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandlerassignment: ",wberrorhandlerassignment,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandlerfile: ", wberrorhandlerfile,"|") ErrorMessage=strcat(ErrorMessage,"wberrortextstring: ", wberrortextstring,"|") ErrorMessage=strcat(ErrorMessage,"wberroradditionalinfo: ", wberroradditionalinfo,"|") ErrorMessage=strcat(ErrorMessage,"wberrorinsegment: ", wberrorinsegment,"|") ErrorMessage=strcat(ErrorMessage,"wberrorhandlerlinenumber: ", wberrorhandlerlinenumber,"|")
However, you have found one exception to the rule...
The issue is that WinBatch is unable to capture that particular error because it happens before the line gets executed. That error gets thrown during the preparsing of the line. Before Winbatch executes any code it parses the line looking for variable subsitution and replaces the %variable% with contents of the variable then WinBatch begins processing to code, hence why it is not getting caught by IntControl 73.
Article ID: W17869
Filename: IntControl 73 Not Capturing Error .txt
File Created: 2009:09:30:13:08:04
Last Updated: 2009:09:30:13:08:04