Monday, November 08, 2010 at 12:04 AM.

system.verbs.builtins.op.outlineToList

on outlineToList (adroutline, flWholeOutline=false, flPreserveBlanks=false) { <<4.2
	<<10/31/97 at 12:16:09 PM by DW -- moved from toys.outlineToList
	local (oldtarget = target.get (), theList, linetext);
	on getList () {
		local (myList = {});
		loop {
			linetext = op.getLineText ();
			if linetext == "" and flPreserveBlanks {
				<<PBS: flPreserveBlanks is an optional parameter, default is false.
				linetext = "\r"};
			if op.countSubs (1) > 0 { <<has subheads
				op.expand (1);
				op.go (right, 1);
				myList [sizeOf (myList) + 1] = lineText;
				myList [sizeOf (myList) + 1] = getList ();
				op.go (left, 1)}
			else {
				myList [sizeOf (myList) + 1] = lineText};
			if not op.go (down, 1) {
				break}};
		return (myList)};
	target.set (adroutline);
	op.setDisplay (false); //3/31/97 -- small performance enhancement
	local (oldcursor = op.getCursor ());
	if flWholeOutline { //5.0 optional param allows a whole outline to turn into a list 11/29/97 DW
		op.firstSummit ()};
	theList = getList ();
	op.setCursor (oldcursor);
	op.setDisplay (true);
	target.set (oldtarget);
	return (theList)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.