# values_cut_over proc

Source: https://ref.dm-lang.org/proc/values_cut_over
Added in BYOND 516.

### Format
> `values_cut_over(Alist, Max, inclusive=0)`

### Returns
> Number of items removed

### Args
- `Alist`: An [associative list](https://ref.dm-lang.org/list/associations.md) or [alist](https://ref.dm-lang.org/proc/alist.md)
- `Max`: The maximum number allowed
- `inclusive`: Also cut items whose value equals Max


Removes all items from the list whose associated values are greater than Max, not numbers, or [NaN](https://ref.dm-lang.org/proc/isnan.md).

If the optional `inclusive` argument is true, items with associated values equal to Max are removed also.

```dm /values_cut_over/
var/list/stuff = list("a"=1, "b"=2, "c"=-4)
values_cut_over(stuff, 0)
for(var/k,v in stuff)
    usr << "[k] = [v]"
// prints:
// c = -4
```

This is a convenience proc for games trying to eke out high performance.

If Alist is not an associative list, nothing happens.

### See also
- [list associations](https://ref.dm-lang.org/list/associations.md)
- [values_cut_under proc](https://ref.dm-lang.org/proc/values_cut_under.md)
