Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-12-17, 08:03 PM   #1
mtp1032
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 22
Naive Question: assert() error message

This is my first foray into LUA and WoW Addon development. So apologies in advance for the naivity.

Note the call to assert() in the function below. While it terminates the program correctly, it doesn't print the error message to the chat frame.

This is so simple that I'm convinced I'm missing something. Does assert(), for example, use a different output that the chat frame?

Any help would be very much appreciated.

Code:
function debugPlay()

	assert( nil, "function terminated.")
	
	stackInfo = debugstack()
	print( stackInfo )
	

	-- 
	-- Get the line number from where the function was called
	--
	for number in string.gmatch(stackInfo, "%d+>")
		do
			print("Function definition at line ", string.match( number, "%d+"))
	        end
	
	
	-- 
	-- Get line number where function was called.
	--
	for number in string.gmatch(stackInfo, "%d+:")
		do
			print("Function called at line ", string.match( number, "%d+"))
	end

end
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Naive Question: assert() error message

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off