How do I create an Object so that it is at the END of the module and not the beginning. |
Re: Create Object so it is at the End of the Module Object o1 = create last m1 this creates an object as a sibling of the last object of the module to create a top level heading you need to cycle through the top level objects and then create after:- Module m1 = current Module Object o1 for o1 in top m1 do; create after o1 |
Re: Create Object so it is at the End of the Module
The following will navigate to the object at the very end of the module object tree - as per the "Objects > Navigation from an Object" section of the DXL Reference Manual - I would recommend you add some tests in the code to determine if this absolutely last object is deleted (for when soft deleted objects are configured to be visible), or if it's a table cell, or any other cases where the last object might not be a suitable candidate for creating a new object after it. Module m = current; Object oFirst = first m; Object oNew = (null oFirst)?(Object create m):(create last sibling oFirst);
Paul Miller
|
Re: Create Object so it is at the End of the Module
Both Sean and Paul are correct, but I think Sean's solution should be the default one. 1. 1.1 1.1.1
2. level 1, "after" the 1st, which is the lowest top-level object as per Sean 1.2 level 2, "after" the 2nd object, or "last below" the 1st. 1.1.2 level 3, "after" the 3rd object, or "last below" the 2nd 1.1.1.1 level 4, "below" the 3rd object
|
Re: Create Object so it is at the End of the Module llandale - Tue Feb 28 15:19:23 EST 2012
Both Sean and Paul are correct, but I think Sean's solution should be the default one. 1. 1.1 1.1.1
2. level 1, "after" the 1st, which is the lowest top-level object as per Sean 1.2 level 2, "after" the 2nd object, or "last below" the 1st. 1.1.2 level 3, "after" the 3rd object, or "last below" the 2nd 1.1.1.1 level 4, "below" the 3rd object
I thought that that was the point of my last sentence - you need to know what level you want that last object to be at, as well as whether the last object is a suitable base for inserting a new object e.g. if it's a deleted object or a table cell object. Paul Miller Melbourne, Australia |
Re: Create Object so it is at the End of the Module SystemAdmin - Mon Feb 27 22:14:21 EST 2012
Hi Sean, Object o1 = first current Module Object o2 = last current Module current = o2
|
Re: Create Object so it is at the End of the Module Reik_Schroeder - Wed Feb 29 01:15:27 EST 2012
Hi Sean, Object o1 = first current Module Object o2 = last current Module current = o2
I knew it worked for navigation but seems it also works for creation |
Re: Create Object so it is at the End of the Module SystemAdmin - Thu Mar 01 08:18:00 EST 2012 Object obj = last mainMod Object newObj = create mainMod move(newObj, obj) |