Skip to main content

function.pacall(arguments)

Calls the function with an array of parameters, bypassing Squirrel error callbacks

Availability

Device + Agent

Parameters

Name Type Description
arguments Array The function’s parameters in array form

Returns

Nothing

Description

This method provides a way of passing an array of values to a function in place of separate parameters. However, unlike the method acall(), which also provides that functionality, pacall() will not trigger Squirrel’s error callback if the function call fails for some reason.

The array passed to pacall() must include sufficient elements to cover all of the function’s mandatory parameters, ie. those without default values.

Like pcall(), pacall() can also pass an alternative context object to the function, effectively exposing the usually hidden first parameter, this. In this instance, the new context object must be placed at the head of the array’s elements, ie. at index zero.

Further Information

For more detailed guidance on the role of context objects in Squirrel, please see Squirrel Closures And Context Objects.