en:throwerror [BASIC 256 - Language Documentation]

# BASIC 256 - Language Documentation

en:throwerror

## ThrowError (Statement)

### Format

throwerror int_expr
throwerror ( int_expr )

### Description

Cause a runtime error to occour. These errors may be trapped with the Onerror statement.

### Example

    onerror errortrap
    print "before error"
    throwerror 99
    print "after error"
    end
    subroutine errortrap()
    print "error " + lasterror + " happened"
    end subroutine

will display

    before error
    error 99 happened
    after error

### See Also

Lasterror, Lasterrorextra, Lasterrorline, Lasterrormessage, Offerror, Onerror, ThrowError, Try / Catch / EndTry

### History

0.9.6.75 | New To Version

en/throwerror.txt · Last modified: 2014/02/09 20:04 by admin