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


on volumeReport (windowtitle, units, callback) { <<creates a volume report window
	<<creates a new BarChart window with the indicated title
		<<loops over all the mounted disk volumes, and calls back with a name
		<<the callback routine returns a value to be displayed in the bar
		<<units is what's displayed next to each value
	if not app.start ("BarChart") {
		return (false)};
	ctbars = file.countVolumes ();
	if app.selectWindow (windowtitle) { <<already has a window with this title
		BarChart.setBarCount (ctbars)}
	else {
		BarChart.newWindow (ctbars, windowtitle, units)};
	ct = 1; <<start by setting the first bar's value and label
	fileloop (fname in "") { <<go thru all the mounted disks
		BarChart.setBar (ct++, fname, callback^ (fname))}}

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.