void MoveNodeUpDown (struct List *list,struct Node *node, BOOL up){
if(up){
struct Node *pred = IExec->GetPred(node);
if(pred){
IExec->Remove(node);
IExec->Insert(list, node, IExec->GetPred(pred));
}
}else{
struct Node *succ = IExec->GetSucc(node);
if(succ){
IExec->Remove(node);
IExec->Insert(list, node, succ);
}
}
}
Note that IExec->Insert() takes three parameters: the list to add to, the node to add and the node to insert after (which may be NULL causing Insert() to add the node to the beginning of the list).
Hi Antikken
Try this:
Hope you get the gist of it.
OldFart
@OldFart
Here is a much simpler version with less bugs:
Note that IExec->Insert() takes three parameters: the list to add to, the node to add and the node to insert after (which may be NULL causing Insert() to add the node to the beginning of the list).