logical deleting and moving

Hi,

Say if I have a list of things to be executed by position number

destroy
1
create
2
destroy with more force
3
create more things
67

I came up with the code to delete pos 1 entry, and then move everybody elses position down by 1 in a for loop, here is the insides
1
2
p[i+1].position--;
p[i] = p[i + 1];

create
1
destroy with more force
2

But what about this position, 67? Should I decrease it by 1 or keep it the same number?

create more things
67(keep code and becomes 66? or modify it so it stays 67?)
Last edited on
closed account (o3hC5Di1)
Hi there,

Terribly sorry, but this is not making much sense to me.
Could you please be a little bit more specific on what it is you are trying to achieve and what part of that you are struggling with?

Thanks!

All the best,
NwN
Hi,

I have a queue of things to execute, and


 A   B   C   D    E
|0| |1| |2| |3| | 67|



If I remove A from the queue, would it make more logical sense in decreasing 67 by 1 or keeping it as 67 as position for queue?
Last edited on
Topic archived. No new replies allowed.