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


on setGlobalTable (adrTable, majorswitch) {
	<<the table becomes the current table
		<<we smash the address at system.misc.paths.cardPath to point at it
			<<its contents become globals
		<<if flmajorswitch is true we install the embedded menubar
			<<this should be set true on activate events in Card Runner
		<<Tue, Sep 3, 1996 at 6:15:11 PM by dmb
			<<New runtime code for running cards inside of Frontier
		<<Thu, Sep 26, 1996 at 4:44:50 PM by dmb
			<<no longer set misc.paths.cardPath
	local (cardInFrontier); <<running inside of Frontier?
	local (destAdr);
	if majorswitch {
		if defined (^.menubar) { <<remove old menubar
			cardInFrontier = (sys.frontmostApp() == file.fileFromPath (Frontier.getProgramPath ()));
			if cardInFrontier {
				menu.remove (^.menubar)}};
				<<destAdr = @system.menubars.[file.creator (sys.frontmostApp())]
				<<if defined (destAdr^)
					<<delete (destAdr) = adrTable;
		if defined (adrTable^.menubar) { <<install new menubar, if present
			cardInFrontier = (sys.frontmostApp() == file.fileFromPath (Frontier.getProgramPath ()));
			if cardInFrontier {
				menu.install (@adrTable^.menubar)}}};
				<<system.menubars.DRPb = adrTable^.menubar
	return (true)}

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.