18.01.2013 Views

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

the chance to deal with it by adding an error handler. If the developer does<br />

not add the error handler, the application will then display the system error<br />

message and most likely terminate the application.<br />

<strong>Visual</strong> <strong>Basic</strong> represents the Device Unavailable error with an internal<br />

number 68. <strong>LotusScript</strong> also represents this error with the internal number<br />

68. Most of the system-oriented errors that are trappable errors in <strong>Visual</strong><br />

<strong>Basic</strong> can be handled by <strong>LotusScript</strong> as well, using the same numbers.<br />

<strong>LotusScript</strong> provides an ASCII file LSERR.LSS, that defines the system<br />

errors it allows you to trap. <strong>Visual</strong> <strong>Basic</strong> provides a list of system, Access<br />

and OLE errors that it allows you to trap on as part of its online<br />

documentation.<br />

There is a general guideline to how the trappable errors are grouped. The<br />

<strong>Visual</strong> <strong>Basic</strong> error groupings are:<br />

1-94 System Errors<br />

260-428 DDE or Form Errors<br />

429-451 OLE Automation Errors<br />

444-521 System Errors<br />

2400-3622 Data Access Errors<br />

4000- Notes Container Errors<br />

31000- 31050 OLE Container Errors<br />

Lotus maps a number of the trappable errors <strong>for</strong> you into constants<br />

declared in the LSERR.LSS file. A snippet of the errors defined within this<br />

file are shown in the following listing:<br />

' Run Time LOI Errors<br />

Public Const ErrFileAlreadyExists = 58<br />

Public Const ErrBadRecordLength = 59<br />

Public Const ErrDiskFull = 61<br />

Public Const ErrInputPastEndOfFile = 62<br />

Public Const ErrBadRecordNumber = 63<br />

Public Const ErrBadFileName = 64<br />

Public Const ErrTooManyFiles = 67<br />

Public Const ErrDeviceUnavailable = 68<br />

14 <strong>LotusScript</strong> <strong>for</strong> <strong>Visual</strong> <strong>Basic</strong> <strong>Programmers</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!