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

system.verbs.globals.edit

on edit (adr, windowTitle=nil, flReadOnly=false, adrButtonTable=nil) {
	<<Open a window for editing. Return the address of the previous target.
		<<Changes:
			<<08/14/00; 2:29:34 PM by PBS
				<<Instead of using a try statement to determine if it's a window-based object or a scalar, use a case statement. Supply the flReadOnly parameter to window.open only if this is 7.0b6 or greater.
				<<If you're using 7.0b5 or earlier, then the flReadOnly parameter has no effect, but it can still be passed to this script without causing an error.
			<<11/2/01; 10:46:03 AM by BS
				<<adrButtonTable is a new optional parameter. If set, it's the address of a table of scripts to attach to buttons in an outline window.
	
	if defined (adr^) { //is it defined?
		case typeOf (adr^) { //is it a window-based object?
			outlineType;
			scriptType;
			menubarType;
			tableType;
			wpTextType {
				local (oldtarget = target.set (adr));
				if windowTitle != nil {
					window.setTitle (adr, windowTitle)};
				if date.versionLessThan (Frontier.version (), "7.0b6") {
					window.open (adr)} //flReadOnly not yet supported
				else {
					if (adrButtonTable != nil) and (not (date.versionLessThan (Frontier.version (), "7.1b18"))) {
						window.open (adr, flReadOnly, adrButtonTable)}
					else {
						window.open (adr, flReadOnly)}};
				return (oldTarget)}}};
	
	<<It's a scalar or it's not defined.
	local (oldtarget = target.get ());
	on kernelcall (adr) {
		kernel (lang.edit)};
	kernelcall (adr)}



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.