A
          / \      _             Play Now                         Nemesis on fb
          | |     | |  _______   _        _   _______    _______   _    _______
          | |\    | | |   ____| |  \    /  | |   ____|  /   ____| | |  /   ____|
 /-------/-------------------------------------------------------------------,
O= Home <=XX|  About  News  Pics  Adventurers  Wizards  Download  Connect     >
 \-------\-------------------------------------------------------------------'
          | |   \   | |  |____  | |      | | |  |____   ___ \  \  | |  ___ \  \
          | |     \_| |_______| |_|      |_| |_______| |_______/  |_| |_______/
          \ /
           V  

Documentation Area

Document Path: /doc/efun/catch


Name: catch - evaluate an expression catching possible errors

Synopsis:
	string catch(string expr)

Description:
	The catch efun evaluates an expression catching errors. The expression
	will terminate evaluating, but the program continues.

	The efun 'throw(value)' can also be used to immediately return any
	value, except 0, from inside catch.

	The catch efun is somewhat costly and should not be used everywhere.
	Rather use it in places where an error would destroy consistency.

Return value:
	If there is no error, 0 is returned. If there is a standard error, a
	string (with a leading '*') is returned.

Examples:
	catch(this_player()->risky_function());

See also:


This page was generated in LPC

Imprint / Impressum