!7 cmodule GListMaker > DynObjectTable { bool active = true; S globalID = aGlobalID(); start { onChange(r { saveStructFile(javaxDataDir("User Lists/" + aGlobalID() + ".txt"), clonedList()); }); } S answer(S s) { if (!active) null; if "list done|done" { dm_call(dm_gazelle_modulesManager(), 'removeModule, this); ret "Okidoki! Here's the final list with " + n_entries(count()) + ", saved as " + globalID + "):\n" + joinWithComma(list()); } new Matches m; if "add ..." { if (contains($1)) ret $1 + " is already on the list!"; add($1); ret $1 + " added to list. Now " + n_entries(count()) + "."; } if "remove ..." { LS list = list(); int i = indexOfIC(list, $1); if (i < 0) ret $1 + " is not on the list anyway."; S item = list.get(i); remove(item); ret $1 + " removed from list!. Now " + n2(list(), "entry", "entries") + "."; } if "what's the list|list" ret empty(list()) ? "Your list is empty." : joinWithComma(list()); null; } // API bool contains(S s) { ret cic(list(), s); } }