Global/ErrorNoHalt

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Fixed bug)
 
Line 4: Line 4:
 
Essentially similar if not equivalent to {{GlobalFunction|Msg}}.
 
Essentially similar if not equivalent to {{GlobalFunction|Msg}}.
  
{{Bug|Fixed=|Issue=1810|Using this function in the menu state exits the menu.}}
 
 
|Realm=Shared and Menu
 
|Realm=Shared and Menu
 
|IsClass=No
 
|IsClass=No

Latest revision as of 16:12, 21 January 2020

 ErrorNoHalt( )

Contents

Description

Throws a Lua error but does not break out of the current call stack. This function will not print a stack trace like a normal error would. Essentially similar if not equivalent to Msg.

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!
This line will be printed
Personal tools
Navigation