Hello, Object firsto = first(current Module) Object lasto = last(current Module) setSelection(firsto,lasto) SystemAdmin - Mon Aug 27 16:24:15 EDT 2012 |
Re: setSelection help
When using the setSelection(Object start, Object finish) function, the "start" and "finish" objects must be siblings, any children under these will be included in the selection.
Object oFirst, oFinish, o
Module m = current
oFirst = first(m) //Assumes that the first object in m is a level 1 object
current = oFirst //Make oFirst this the current object
o = current //Set o to be current in prep for the While loop
while (!null next sibling o ){//Trying to find the last level 1 sibling to oFirst
o = next sibling o //if next sibling o = null, then o in this loop is currently pointing to the last level 1 sibling
}
oFinish = o
setSelection(oFirst, oFinish)
|