J
jdelaney44
Hi.
Pretty sure I understand ActiveProject.Tasks.Add adds tasks at the
bottom of the schedule, gives the new task the next available UID and
ID.
What I would like to do is something like this -
1.) Find a task in the tasks collection (I can do this, no problem)
2.) Insert a new task "below" that one, realizing of course that
"below" in the collection is a virtual thing
The only way I can figure to do that is to something like this -
1.) Add the task
2.) Keep the task in something called NewTask
3.) Find the ID of the task I want to insert below (TaskIWantID)
4.) Walk down the entire task collection incrementing each ID greater
than TaskIWantID by one
5.) Set NewTask.ID = TaskIWantID + 1
Doesn't seem all that hard, but I wanted to see if there was another,
smarter, way to do this.
Note, I really don't want to use EditInsert, I'm trying to make this
less screen dependent.
If I need to go off into C# or something, that's cool too. I guess
I'll go hunting down that path next.
Thanks
John
Pretty sure I understand ActiveProject.Tasks.Add adds tasks at the
bottom of the schedule, gives the new task the next available UID and
ID.
What I would like to do is something like this -
1.) Find a task in the tasks collection (I can do this, no problem)
2.) Insert a new task "below" that one, realizing of course that
"below" in the collection is a virtual thing
The only way I can figure to do that is to something like this -
1.) Add the task
2.) Keep the task in something called NewTask
3.) Find the ID of the task I want to insert below (TaskIWantID)
4.) Walk down the entire task collection incrementing each ID greater
than TaskIWantID by one
5.) Set NewTask.ID = TaskIWantID + 1
Doesn't seem all that hard, but I wanted to see if there was another,
smarter, way to do this.
Note, I really don't want to use EditInsert, I'm trying to make this
less screen dependent.
If I need to go off into C# or something, that's cool too. I guess
I'll go hunting down that path next.
Thanks
John