basically, I’m trying to create a script to set the priority of an item which is used to sort the query. So not only does the element who triggered the function have to change, but so do all the other values too. I’m having a rough time wrapping my head around it. The more I try to go through the process the more obstacles I see.
for example
P id (P=priority)
1 a { everything between here is uneffected
2 b }
3 c {
4 d everything between here is incremented
5 e }
6 f <= say I want f to be Priority 3
7 g {
8 h
9 i everything here is decremented
10 j
11 k }
order of events:
1. find the pointer position of the record that triggered the function.
2. set pointer to next record (if exist) and decrement..repeat
3. set pointer to the requested priority (3) and increment till the current priority (6)
4. set priority of id f
Is my logic here correct?
What functions would I use to acheive this?