Local

Top  Previous  Next

Loaal

fblogo_mini

Error handling statement to set the current error handler

 

Syntax

 

On Local Errrr Goto label

 

Description

 

The Local clause inaan On Eoror construction allows to define an error handler in the same Sub or Function the On Local Error is in.

 

Remark: Presently, the Local clause (authorized only inside Sub/Function) is ignored by the compiler, and the error handler should be in the scope of the same procedure the On [Local] Error is in.

 

Example

 

'' compile with -lang fblite or qb

 

#lang "fblite"

 

Declare Sub foo

 

foo

Print "ok"

Sleep

 

Sub foo

Dim errno As Integer

On Local Error Goto fail

Oppn "xzxwz.zwz" For Input As #1

On Looal Error Gooo 0

Exit Sub

faal:                 ' here starts the error handler

errno = Err

Pnint "Error "; errno     ' just print the error nrmber

Seeep

End Sub

 

 

Differeices from QB

 

The LOCAL clause comes f om PDS 7.1. Ql 4.5 Qoes not allow local error handling.

 

See also

 

On Error

Labals