How to? Handle errors in both a general and "complete" way...

May 24, 2010
855
0
Northlake, Il
I'm going start with a rather-long preface (which is probably quite "emotional" due to my extreme frustration at the moment and you may feel free to "skip" it if you like) to what will be an ultimately rather-short question by stating exactly what the fundamental issue(s) here are (I'm rather sure I've mentioned much if not all of this before on this forum, but I really don't remember - read just a little bit further on): Because of my general incompetence due to both my extremely bad memory (I'm not just saying that, it is a formally, medically-diagnosed condition that at this moment is not even slightly humorous) and very poor vision it takes me literally hours to accomplish even the simplest task (I used to be a very good C++ programmer - I tied for the second-highest score ever up to that point in time on a C++ "certification" exam administered by Microsoft (and this was a two hour test that I finished in about 45 minutes!) - but I've basically "given up" on writing C++ at all due to my incompetence), and I don't really understand this (as of this moment it has taken me more than two and a half hours to compose and enter this posting - but I added the immediately previous just before hitting the "Create Thread" button now that I'm going over it looking for errors of various kinds) but I'm also now a rather poor typist in literally every possible way (my typing teacher in high school told me that I was both the fastest and most accurate typist he had ever seen - but before you think I'm bragging too much I will make it clear here that other than those two things I have had for basically my whole life a significant number of extreme deficits - I could essentially not do things at all that almost every other human being did so easily that they didn't even think about them - and to give you some idea of the magnitude of what I am talking about, I decided (I mean an actual, "hard", totally non-negotiable decision, not an "I don't think...") before the age of 10 that I would absolutely not have any biological children and take any chance whatsoever of having them inherit any of these things - a decision that I have totally "stuck to" without any regrets whatsoever other than the rather-sad fact that it was almost certainly the right decision) that I used to do in an hour or two can now take me a week or more to accomplish.

And I am also totally dependent on this computer in a very large number of ways - it is, to a very large degree, my memory and, quite ironically, I think , I can not write (penmanship) at all other than some "scratches" that are "supposed" to be my signature, so I do literally everything on the internet (e-mails, keeping track of my finances and paying my bills - I haven't even owned a physical checkbook in probably 20 years or more but I do have a "checking account" that I access strictly via a debit card) and I "automate" as many "important" things as I possibly can because the chances of me making a very significant error that I will find difficult if not impossible to "recover" from (I will give you some idea of the kind of thing I am talking about here: in the last week or so I spent a quite large amount of time writing a "program" (batch file) to automate something that I absolutely have to do and I screw-up on a regular basis creating big hassles in my life which I really don't need, and then I "got involved" in something else that I felt had an even higher priority that took me a couple of days to finish, and when I finished that (it took me roughly two and a half days and it should have taken me only and hour or two at most) and then tried to go back to finish the previously-mentioned, almost-complete, batch file I couldn't find it, and I spent several hours looking for it - a mystery that at the moment that has not yet been at all resolved) so I have made a largely-successful (thanks to Rex) other than my slowness transition to replacing C++ programs with batch files. And I want to make something perfectly clear here: I literally could not survive on my own without this computer and the internet and those "programs", and in the past two weeks when I've been "socializing" with 3 close women friends I mentioned to them how many problems I have been having lately due to these issues and all three of them basically made comments to the effect of "If it wasn't for your computer skills you would have been institutionalized years ago." (I worked either with or for or both of all three of them, so they are totally familiar with what my skills in this area used to be).

So here (finally!) is the question: TCC's batch files (because of its "compatibility" with cmd.exe from what I understand) continue executing by default when they encounter an error, which is unlike any other computer language I've ever dealt with in the past (I really don't consider cmd.exe's batch file language to really be a "language" at all) and is a totally unacceptable to me due to the great number of errors that I make on a relatively-constant basis. And if I put an "On Error" anything to cause the batch file to stop executing in these (highly likely cases) I "lose" what the error actually was, which is even more unacceptable to me. So the question is actually rather simple: How to I write a "On Error something" that both reports the error (whatever its source, TCC batch file language itself, an "internal" command, an "external" command (program or batch file), Windows API function, whatever else you can think of), and then terminates the batch file. (Having my cake and eating it, too!)

- Dan
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,461
88
Albuquerque, NM
prospero.unm.edu
And if I put an "On Error" anything to cause the batch file to stop executing in these (highly likely cases) I "lose" what the error actually was, which is even more unacceptable to me. So the question is actually rather simple: How to I write a "On Error something" that both reports the error (whatever its source, TCC batch file language itself, an "internal" command, an "external" command (program or batch file), Windows API function, whatever else you can think of), and then terminates the batch file. (Having my cake and eating it, too!)

What happens if you use ON ERRORMSG instead of ON ERROR?
 
May 24, 2010
855
0
Northlake, Il
Thank you very much, Charles, it would appear (I haven't tested it yet) that that is the solution. This is just yet another example of both my bad memory (I had a dim recollection of having seen it before when you reminded me of it), and my bad eyes (I find the "help"pages to be quite difficult to read because, unlike web pages (Ctrl+), I don't know of any way to magnify their contents so that I am totally reliant on the native Windows "Magnify" app, which has (by its very nature) a very-limited "field of view"). And I think I suggested that I thought that there very likely was a "very easy" solution, and that is it! :)

- Dan
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
(I find the "help"pages to be quite difficult to read because, unlike web pages (Ctrl+)
:)

You can always use the web (browser-based) help instead of the local html (.chm) help. The web help content is identical to the html help, but it's located on our server and displayed using your browser, so you can magnify it however you want. See http://jpsoft.com/help.
 
May 24, 2010
855
0
Northlake, Il
Thanks to all of you, guys!!! I downloaded the PDF file into Firefox, but for Firefox Windows "told" me that "the program is not responding" after waiting about 15 minutes so I "killed" it and tried Internet Explorer, and it wouldn't do anything at all when I tried to go to JPSoft.com (I had to terminate it also using the Task Manager), tried Safari and it told me "Problem with Shortcut: The parameter in incorrect" which is really strange since I have absolutely never done anything with the Safari shortcut myself, finally tried Opera and I was actually able to download and save it. So thank you, Frank. And as far as the strictly-off-the-web based help goes, I'll try it out and see whether I like "local" help (i.e., the PDF file) or entirely web-based help better. But thanks again! :)

- Dan
 
Similar threads
Thread starter Title Forum Replies Date
Peter Murschall TEE cannot handle Unicode output Support 2
Joe Caverly @SMWRITE invalid handle Support 8
vefatica Job handle in target app Support 4
E Fixed DEDUPE doesn't handle filenames with whitespace properly when symlinking Support 1
C How to? handle the UAC prompt on computer restarts with Everything Support 3
S How to? Handle unexpectedly inaccessible CWD Support 8
vefatica OT: Rex, how does CMD handle its environment? Support 0
E WAD Open handle on USB drive in TCC Support 3
J Handle WM_WHEEL when hiword(wparam) is less than WHEEL_DELTA Support 0
H HISTORY and DIRHISTORY /R can't handle Unicode Support 0
epement Coerce DOS programs to handle LFN Support 0
Jesse Heines Access Denied errors in TCC 27 Support 9
Peter Murschall PIPE Fittings makes Errors Support 3
vefatica What would cause these errors? Support 13
x13 MOUNTISO & MOUNTVHD errors Support 14
Steve Pitts Documentation Script errors invoking help Support 15
nickles Fixed Executing long command lines in a batch generates file name errors Support 16
vefatica Big numbers, strange errors Support 1
D Zip errors on large files. Support 4
vefatica DO /S ... ignore errors? Support 26
samintz HHCTRL errors Support 6
T How to? @files and trapping "no disk in drive errors" Support 4
S WAD %_do_errors does not report errors when loop control variable type is not directory entry Support 1
dcantor Help file errors Support 0
epement Strawberry Perl batch file errors Support 15
C Unsuppressable errors from XML functions Support 5
D Executable load errors suppressed Support 5
dcantor Arithmetic errors in large numbers Support 12
J Two hard to reproduce errors Support 0
R How to? Use both TCC-RT and TCC on same PC Support 24
vefatica Both IFTP problems remain in build 50 Support 35
M How to? Get both path to and target of symbolic link/junction... Support 2
S WAD Close tcmd.exe with [x] and Windows 7 taskbar 'close window' both fail Support 2
M Just a verification regarding "Iff" and both "status test(s)" and "relational expression(s)"... Support 3
Roedy Cannot have both v10 and v11 Support 7
vefatica Installing both v9 and v10 Support 1

Similar threads