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

system.verbs.builtins.Frontier.tools.nodeTypes.findNodeType

on findNodeType (type = "", adradrtable) {
	<<Changes
		<<Tuesday, August 22, 2000 at 7:38:15 PM by DW
			<<Allow the user's nodetype definitions to be addresses, or addresses of addresses or..
		<<5/9/01; 2:29:30 PM by JES
			<<If the app is Radio UserLand, look for nodeTypes in playlist.data.nodeTypes, as well as Frontier.tools.data.nodeTypes.
		<<7/7/01; 3:29:58 AM by JES
			<<Follow addresses for builtin nodeTypes, as well as user nodeTypes
		<<7/13/01; 8:52:28 PM by JES
			<<The nodeTypes at Frontier.tools.data.nodeTypes supercede the ones at playlist.data.nodeTypes
		<<8/20/01; 10:19:53 PM by JES
			<<Only look for a nodeType in playlist.data.nodeTypes if playlist.data.nodeTypes is defined.
		<<8/29/01; 12:16:52 PM by JES
			<<Added legacy support in Radio, for user-defined nodeTypes at user.playlist.nodeTypes.
		<<8/30/01; 10:56:24 PM by JES
			<<Fixed a bug where when searching for a nodeType in user.playlist.nodeTypes, the playlist.data.nodeTypes table was incorrectly searched instead.
	if type == "" {
		if not op.attributes.getOne ("type", @type) {
			return (false)}};
	local (adrtable = @user.tools.nodeTypes.[type]);
	if defined (adrtable^) {
		while typeof (adrtable^) == addresstype {
			adrtable = adrtable^};
		adradrtable^ = adrtable;
		return (true)};
	if system.environment.isPike { //08/29/01 JES: legacy support for user.playlist.nodeTypes
		if defined (user.playlist.nodeTypes) {
			local (adrtable = @user.playlist.nodeTypes.[type]);
			if defined (adrtable^) {
				while typeof (adrtable^) == addresstype {
					adrtable = adrtable^};
				adradrtable^ = adrtable;
				return (true)}}};
	adrtable = @Frontier.tools.data.nodeTypes.[type];
	if defined (adrtable^) {
		while typeof (adrtable^) == addresstype {
			adrtable = adrtable^};
		adradrtable^ = adrtable;
		return (true)};
	if system.environment.isPike { //05/09/2001 JES: support Radio's nodeTypes
		if defined (playlist.data.nodeTypes) {
			local (adrtable = @playlist.data.nodeTypes.[type]);
			if defined (adrtable^) {
				while typeof (adrtable^) == addresstype {
					adrtable = adrtable^};
				adradrtable^ = adrtable;
				return (true)}}};
	return (false)}
<<bundle //test code
	<<dialog.alert (findnodetype ("", @adrtable))
	<<dialog.alert (adrtable)



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.