Queue.len Shared function

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

This function was added in version: 0.1.0

Method gets current queue length.

Syntax

int queue.len()

Returns

Amount of the elements in the queue.

Example

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

	test_queue.push(1); // this two lines are adding some values into queue
	test_queue.push(2);

	print(test_queue[0]); // this will print "1"
	print(test_queue.len()); // this will print "2" because we add two values into queue
});

Related functions