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


on getPref (prefName, adrPageTable=nil) { <<new in 4.1
	<<Look for a preference directive, a global pref, or return a default.
		<<New: Mon, Sep 9, 1996 at 9:45:08 AM by PH
		<<Tweaked performance: Wed, Dec 11, 1996 at 6:37:21 PM by DW
			<<Using an address and simplifying logic reduced 100 loops from 65 ticks to 21
			<<(double (21) / 100) / 60
		<<Tuesday, May 04, 1998  -- kernelized by dmb.
	<<old code:
		<<local (val)
		<<try <<try to get it from pagedata
			<<val = adrpagedata^.[prefName]
			<<case val
					<<return (true)
					<<return (false)
				<<return (val)
		<<try <<try to get it from user.html.prefs
			<<return (user.html.prefs.[prefName])
		<<case string.lower (prefName) <<return a default value
				<<return (".html")
				<<return (31)
				<<return ("normal")
		<<else <<unknown or default prefs are true
			<<return (true)
	local (pageTable);
	if adrPageTable == nil {
		try {
			adrPageTable = html.getPageTableAddress ()}
		else {
			new (tableType, @pageTable);
			adrPageTable = @pageTable}};
	on kernelCall (prefName, adrPageTable) {
		kernel (html.getpref)};
	return (kernelCall (prefName, adrPageTable))}

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.