Meta Project

The Unofficial Meta Documentation

TRY

Summary

TRY is used to prevent operations that may likely fail to cause a program error.

Category

Categoryname

Usage

TRY statement

Arguments

staement - statement to execute despite the chance that it may fail

Refinements

This method has no refinements

Description

TRY is used to prevent operations that may likely fail to cause a program error. For example opening a file can fail and instead of your program breaking, you want to handle the exception gracefully.

Example Code

Example of TRY when reading a header file

header-file= ./myheader.txt
Either headerfile= try open header-file [
    write/line "Loading header information"
    ...
    close headerfile
][
    write/line "Not able to open and read header information"
    bye
]

Related

N.A.

Back to the Meta Methods Reference index