---
name: "BIS_fnc_priorityQueue_PopItem"
type: function
status: ok
groups: ["Priority Queue"]
arma3_since: "1.86"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_priorityQueue_PopItem
revid: 274273
updated: 2021-06-13T01:19:49Z
---

# BIS_fnc_priorityQueue_PopItem

*Function · Priority Queue · Arma 3 v1.86*

## Description

/*

Pops the item with the highest priority from the Queue (item with highest index). The item is removed from the Queue. Complexity: O(1)

## Syntax

```sqf
[] call BIS_fnc_priorityQueue_PopItem
```

**Parameters:**

- `_handle` — INT - Queue handle (get it with BIS_fnc_PriorityQueue_Init)
  _keep:BOOL - if true, the item is not removed from the Queue

**Returns:** _item:ANY - the item stored in the Queue

## Examples

### Example 1

```sqf
_myItem = [_priorityQueue_1] call BIS_fnc_PriorityQueue_PopItem;
```

## Function header

The comment at the top of the function's file in the game; this page's description, params, returns, examples come from it.

```sqf
/*
/*
    Author: Zozo

    Description:
    Pops the item with the highest priority from the Queue (item with highest index).
    The item is removed from the Queue.
    Complexity: O(1)

    Parameters:
    _handle:INT - Queue handle (get it with BIS_fnc_PriorityQueue_Init)
    _keep:BOOL - if true, the item is not removed from the Queue

    Returns:
    _item:ANY - the item stored in the Queue

    Syntax:
    _item:ANY = [_handle] call BIS_fnc_PriorityQueue_PopItem;

    Example:
    _myItem = [_priorityQueue_1] call BIS_fnc_PriorityQueue_PopItem;
*/
```

<sub>Source: [BI Community Wiki — BIS fnc priorityQueue PopItem](https://community.bistudio.com/wiki/BIS_fnc_priorityQueue_PopItem) (revision 274273).</sub>
