ErrorNoHalt

From Garry's Mod
Jump to: navigation, search
 ErrorNoHalt( )

Contents

Description

Throws a Lua error but does not break out of the current call stack.

BUG

Using this function in the menu state exits the menu.

Issue Tracker: #1810

Arguments

vararg arguments

Converts all arguments to strings and prints them with no spacing.

Examples

Example

An example of the use of this function

local num = 11
if ( num <= 10 and num >= 0 ) then
	print( "The number is", num )
else
	ErrorNoHalt( "Number out of range!\n" )
	print("This line will be printed")
end

Output:

Number out of range! 1. lua/example.lua:5 (unknown) This line will be printed
Personal tools
Navigation