Sort functionality on 800xa
> "It's basically for priority selection of containers"
A simple bubble sort works just fine for this. You only have 4 inputs so you can do this quickly with a for next loop in a single program execution.
You only have 4 items so a bubble sort is pretty quick for this.
Also remember, that you are already looping, so you dont really need a repeat/until or for/next loop as long as you dont need the answer immediately. The sort will allways execute in n-1 program scans or better.