[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: What's that XX doin' there where a backslash should be?



Reply to note from Harry Binswanger  Thu, 19 Feb 2004
16:19:39 -0500

> How do you have the program report only those errors you want
> reported? A lot of IF tests?

You only need one IF test at any given checkpoint. You can trap _any_
error (>...), or only specified errors. Suppose you want
to trap any of the following errors, and no others:

9  Disk(ette) is full.
163 Disk is full writing to overflow file--free up space on drive c:
195 Drive is not ready.
227 Invalid drive.

What you do is create a lookup table of those numeric ERror codes, and
test for containment of  in the table. Like this:

>>;*;
+"|")>;*;
...

Same, in DECODE-able XPL:

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}IF{<}ER{>}{>}{<}SX01,{<}VA$ER{>}{>};*;[cr|lf]{<}IF"|9|163|
195|227|"{240}("|"+{<}IS01{>}+"|"){>}{<}PR\@01{>}{<}EX{>}{<}E
I{>};*;[cr|lf]{<}EI{>}...[cr|lf] [cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx