IB Statements/noexcp

From CometWiki

< IB Statements(Difference between revisions)
Jump to: navigation, search
(explained use of noexcp better)
 
(14 intermediate revisions not shown)
Line 1: Line 1:
-
'''Noexcp'''
+
'''NOEXCP option on file system statements'''
-
C32 Only
+
Parameter:  NOEXCP
-
CREATE 'file',dir='dir',noexcp
+
Discussion:
 +
Introduced with Comet32 this parameter may be used in file system statements to specify that if a non-fatal runtime exception occurs it should be ignored.<br> This option is available for:
 +
ERASE,
 +
ENTER,
 +
EXTRACT,
 +
CREATE,
 +
CREATEKEY,
 +
DELETE,
 +
INPUT,
 +
INPUTFILE,
 +
INQUIRE,
 +
INSERT,
 +
POSITION,
 +
PRINTFILE,
 +
PRINT,
 +
OPEN,
 +
UPDATE,
 +
READ,
 +
RENAME,
 +
REWRITE,
 +
RUN,
 +
LOCK,
 +
UNLOCK,
 +
WRITE.
 +
 +
For information about handling specific exceptions, see Exception Handling.
-
You can use noexcp on any of the following:
+
Note that the EXCP variable will still contain the last exception encountered, and will not be set to zero. This allows a form of "goto less programming"
-
Input<br/>
+
Also see [[IB_Statements/excpsub|ExcpSub]]
-
Print<br/>
+
 
-
InputFile<br/>
+
'''Example:'''
-
PrintFile<br/>
+
-
Create<br/>
+
EXCP=0
-
Erase<br/>
+
ERASE file$ dir=dir$ NOEXCP
-
Open<br/>
+
CREATE file$ dir=dir$ NOEXCP
-
Read<br/>
+
Close(LUN) & OPEN(LUN)file$ dir=dir$ NOEXCP
-
Write<br/>
+
if EXCP ne 0 print 'got an error ';EXCP;' creating ';file$
-
Extract<br/>
+
 
-
Update<br/>
+
 
-
Delete<br/>
+
See [[System_Variables|System Variables]] and [[IB_Statements/EXCP|Excp]] for more information.
-
Input<br/>
+
-
Print<br/>
+
-
Rename<br/>
+
-
Lock<br/>
+
-
Unlock<br/>
+
-
Run<br/>
+
-
Insert<br/>
+
-
Rewrite<br/>
+
-
Enter<br/>
+
-
Inquire<br/>
+
-
CreateKey<br/>
+
-
Position<br/>
+

Latest revision as of 18:07, 4 June 2016

NOEXCP option on file system statements

Parameter: NOEXCP

Discussion: Introduced with Comet32 this parameter may be used in file system statements to specify that if a non-fatal runtime exception occurs it should be ignored.
This option is available for:

ERASE,
ENTER,
EXTRACT,
CREATE,
CREATEKEY,
DELETE,
INPUT,
INPUTFILE,
INQUIRE,
INSERT,
POSITION,
PRINTFILE,
PRINT,
OPEN,
UPDATE,
READ,
RENAME,
REWRITE,
RUN,
LOCK,
UNLOCK,
WRITE.

For information about handling specific exceptions, see Exception Handling.

Note that the EXCP variable will still contain the last exception encountered, and will not be set to zero. This allows a form of "goto less programming"

Also see ExcpSub

Example:

EXCP=0
ERASE file$ dir=dir$ NOEXCP
CREATE file$ dir=dir$ NOEXCP
Close(LUN) & OPEN(LUN)file$ dir=dir$ NOEXCP
if EXCP ne 0 print 'got an error ';EXCP;' creating ';file$


See System Variables and Excp for more information.

Personal tools