User code swap area - what do you think?

Would you use a code swap area?
[poll]

  • YES - I’d even upload good examples
  • Yes - I’d love to mooch from other people’s work
  • No - not useful for me
    [/poll]
    What do you think about a web area where users could post FactoryPMI code examples. It would be similar to the FactoryPMI goodies page. The idea is that users could share reusable code, such as: Component Palettes, script library modules, images, or windows. A rating system might be in order and I image the good examples could make it to the main goodies page. Who knows, we might even be able to give credit to users who provide good resources.

What do you think?

Here are some great examples that I found already on the forum:
MickyBob’s Function to Write CSV File
Carl’s dragable “zoom” rectangle
My Compass
Step7’s button that swaps 2 images quickly
Carl’s home made indicator from a basic rectangle
Kyle Chase’s code to manage and store files in a MySQL database

I love it - I say we just replace the “goodies” area with this - and seed it with the current goodies.

Seeing how ctg just got… released?.. ill add my ctg scripts ive been using for a little while. I dont use pointID, i use tag, but other then that, everything else is the same i think. The ctg i recieved didnt dynamically generate the dropdown, meaning that is the graph was cleared, it would still say clear. And if the point was already added to the chart, it would still say add. You get the point

[code]if event.button == event.BUTTON3:
menuNames = []
menuFunctions = []

		menuNames.append("<html>Wiki")
		menuFunctions.append(openWiki)

		menuNames.append("<html>Files")
		menuFunctions.append(showFiles)
		
		cid = fpmi.system.getClientId()
		if cid == None:
			def logout(event):
				import fpmi
				fpmi.security.logout()
			menuNames.append("sep")
			menuFunctions.append(None)

			menuNames.append("<HTML>Error.Logout")
			menuFunctions.append(logout)
		else:
			add_del = fpmi.db.runScalarQuery("select 1 from ctg_active_client where pointID='%s' and client_ID='%s'"%(event.source.Tag,cid))

			if add_del:
				def delFromGraph(event):
					import app
					app.ctg.deleteGraphPoint(event.source.Tag)

				menuNames.append("<html>(-) Delete from Graph")
				menuFunctions.append(delFromGraph)
			else:
				def addToGraph(event):
					import app
					app.ctg.addGraphPoint(event.source.Tag)

				menuNames.append("<html>(+) Add to Graph")
				menuFunctions.append(addToGraph)
		
		active = fpmi.db.runScalarQuery("select 1 from ctg_active_client where client_ID = '%s'" %cid)
		if active:	
			menuNames.append("sep")
			menuFunctions.append(None)

			def clearGraph(event):
				import app
				app.ctg.clearGraphPoints()

			menuNames.append("Clear Current Graph")
			menuFunctions.append(clearGraph)
		def showPopup(event = event, menuNames = menuNames, menuFunctions = menuFunctions):
			import fpmi
			menu = fpmi.gui.createPopupMenu(menuNames, menuFunctions)
			menu.show(event,event.x,event.y)
		fpmi.system.invokeLater(showPopup)[/code]