Wednesday, April 06, 2011 at 12:01 AM.

system.verbs.builtins.opmlEditor.member.initMember

on initMember (membername, groupname="default", flcreate=false) {
	<<Changes
		<<4/3/11; 4:35:14 PM by DW
			<<Init stats.ctLocalAccessess.
		<<3/7/11; 4:33:50 AM by DW
			<<Created. 
	local (f = system.temp.mainResponder.membersRootFile);
	local (adrmembers = @[f].[groupName]);
	if not defined (adrmembers^) {
		new (tabletype, adrmembers)};
	local (adrmember = @adrmembers^.users.[membername]);
	if not defined (adrmember^) {
		if not flcreate {
			scripterror ("Can't find the member named \"" + membername + ".\"")};
		new (tabletype, adrmember)};
	bundle { //prefs
		if not defined (adrmember^.prefs) {
			new (tabletype, @adrmember^.prefs)};
		if not defined (adrmember^.prefs.enabled) {
			adrmember^.prefs.enabled = true};
		if not defined (adrmember^.prefs.password) {
			adrmember^.prefs.password = string.getrandompassword (10)}};
	bundle { //stats
		if not defined (adrmember^.stats) {
			new (tabletype, @adrmember^.stats)};
		if not defined (adrmember^.stats.ctInits) {
			adrmember^.stats.ctInits = 0};
		if not defined (adrmember^.stats.ctValidate) {
			adrmember^.stats.ctValidate = 0};
		if not defined (adrmember^.stats.ctNotValidate) {
			adrmember^.stats.ctNotValidate = 0};
		if not defined (adrmember^.stats.ctLocalAccessess) { //4/3/11 by DW
			adrmember^.stats.ctLocalAccessess = 0}};
	adrmember^.stats.ctInits++;
	return (adrmember)};
bundle { //test code
	init ("dave", flcreate:true)}



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.