Queue.back Shared function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version: 0.1.0

Method gets last element from the queue.

Syntax

element queue.back()

Returns

Last element pushed into the queue.

Example

addEventHandler("onInit",function(pid)
{
	local test_queue = queue();

	test_queue.push("first"); // this three lines are adding some values into queue
	test_queue.push("second");
	test_queue.push("last");

	print(test_queue.back()); // this will print "last" because it's getting first value from the queue

});

Related functions