Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

lua pcall

-- Basic syntax:
status, value = pcall(function, arg1, arg2, ...)
--[[ Where:
	- pcall is used to add error handling to functions and works similarly to
  		try-catch (try-except) in other languages
	- function is the function you want to run in protected mode
  	- arg1, arg2, ... are the arguments passed to function and should be strings
	- pcall returns two values:
	   1. a boolean which indicates whether function was executed without errors
       2. the return value of the function (or error message if an error 
  			occurred inside the function block
]]--
Source by riptutorial.com #
 
PREVIOUS NEXT
Tagged: #lua #pcall
ADD COMMENT
Topic
Name
4+8 =