Attempt - Function SummarySummary:Tries to evaluate and returns result or NONE on error. Usage:attempt value Arguments:value - The value argument. Description:The ATTEMPT function is a shortcut for the frequent case of:
The format for ATTEMPT is:
ATTEMPT is useful where you either do not care about the error result or you want to make simple types of decisions based on the error.
ATTEMPT returns the result of the block if an error did not occur. If an error did occur, a NONE is returned. In the line:
the value is set to NONE if the %data file cannot be loaded (e.g. it is missing or contains an error). This allows you to write conditional code such as:
Or code such as:
Related:error? - Returns TRUE for error values.
| ||||||
|