# Load a saved custom display. # # Copyright (C) 2005 Neil Moore . Distributed with NO WARRANTY # under the terms of the GPL, version 2 (only). if(msg.box != NULL) { Msg("Loading {gold}Load.command"); } def CommandLoad { push(f); push(i); push(filt); push(wanted); if(length(ARG) > 0) { filt = NULL; i = toint(ARG[0]); if(i==0 && ARG[0] != "0") { i = NULL; } if ( length(ARG) == 1 && i != NULL) { if(i==0) { filt = ("Default", 'default', 'default'); } else if(i > 0 && i <= length(book.my_filters)) { filt = (book.my_filters)[i-1]; } } else { wanted = uc(join(ARG, " ")); if(wanted == "DEFAULT") { filt = ("Default", 'default', 'default'); } else if(length(book.my_filters)) { for(f)(book.my_filters) { if(uc(f[0]) == wanted) { filt = f; } } } } if(filt == NULL) { Msg("{red}No such filter {orange}'" + join(ARG, " ") + "'{red}."); } else { Msg("{gold}Selecting display {orange}" + filt[0] + "{gold}."); SetBookIndex(tail(filt)); } } else { Msg("{gold}Available displays:"); Msg("0. {orange}Default"); i = 1; for(f)(book.my_filters) { Msg(tostr(i) + ". {orange}" + f[0]); i = i+1; } } wanted = pop(); filt = pop(); i = pop(); f = pop(); } HELP{"any"}{"load"}=("display","load a saved display",NULL, "Loads a display previously saved with {cyan}/display{white}. {yellow}{white} is the name of the display, or its number; if it is not given, all displays are listed.");