Search
 
SCRIPT & CODE EXAMPLE
 

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
]]--
Comment

pcall lua

if pcall(foo) then
      -- no errors while running `foo'
      ...
    else
      -- `foo' raised an error: take appropriate actions
      ...
    end
Comment

PREVIOUS NEXT
Code Example
Lua :: svelte template vite 
Lua :: check if string is in string[] c# 
Lua :: attempt to call a string value lua 
Lua :: check if player is in group 
Lua :: int and float in lua 
Lua :: https://web.roblox.com/games/1334669864/Lua-Learning-Bloxy?refPageId=e6fa4d30-3657-463c-b6f0-a32a84183315 
Lua :: lua math.random 
Lua :: pico8 poke 
Lua :: lua how to default value if nil 
Lua :: roblox can I have player animations on the server 
Matlab :: matlab read from txt file 
Matlab :: streamline matlab 
Matlab :: matlab 
Matlab :: matlab stop running function 
Matlab :: SAVE TABLE IN MATLAB 
Basic :: virtualbox 256 vram 
Basic :: change c code to c++ online 
Elixir :: elixir try catch 
Elixir :: elixir get_in access all 
Elixir :: elixir nested if 
Scala :: scala option 
Scala :: scala check if seq container true booleans 
Excel :: google sheets select element after split 
Excel :: google sheets conditional formatting other sheet 
Perl :: len perl 
Pascal :: pascal cheat sheet pdf 
Gdscript :: godot get global position 3 
Abap :: abap char variable 
Assembly :: include code in latex 
Assembly :: gridbaglayout span 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =