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


on getCheckSum (msgnum, adrmemberinfo) {
	if not defined (adrmemberinfo^.randomnumber) {
		adrmemberinfo^.randomNumber = random (0, 1000);
		filemenu.savemyroot (adrmemberinfo)};
	local (checksum = 0);
	on addtochecksum (s) {
		local (i);
		for i = 1 to sizeof (s) {
			checksum = checksum + number (s [i])}};
	addtochecksum (string (msgnum));
	addtochecksum (string (adrmemberinfo^.password));
	addtochecksum (string (adrmemberinfo));
	addtochecksum (string (adrmemberinfo^.randomNumber));
	<<bundle //debugging code
		<<if not defined (scratchpad.checksums)
			<<new (tabletype, @scratchpad.checksums)
		<<local (adrtable = @scratchpad.checksums.[string ( ())])
		<<new (tabletype, adrtable)
		<<adrtable^.msgnum = string (msgnum)
		<<adrtable^.password = string (adrmemberinfo^.password)
		<<adrtable^.adrmemberinfo = string (adrmemberinfo)
		<<adrtable^.randomnumber = string (adrmemberinfo^.randomNumber)
		<<adrtable^.checksum = checksum
	return (checksum)}
<<bundle //test code
	<<local (adr = @["C:\\Palm Springs\\Nirvana Server\\ops\\members.root"].scriptingNews.users.[""])
	<<dialog.alert (getchecksum (902, "ABCDEFG", adr))

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.