		/** Load Files Once With Messages  **/
/*A: K McIsaac*/
/*S: University of Western Australia, Nedlands 6009, Australia*/
/*D: June 1987 */
/*K: Get;Load;Insert */
/*B: Should use a trace statement */
/*P: Loadonce */
/*: Loadonce[$file]
	Modified loadonce that prints messages about the file load status*/

Loadonce[XLoadonce];
<XPrW

/* Dummy statement that never suceeds but prints the warning messages */
Loadonce[$file_=(If[~Loadedp[$file],\
	PrhW[Fmt[,"Loading file ",$file]],\
	PrhW[Fmt[,"File ",$file," is already loaded"]]];0)] :: 1
 
/*W Files loaded with Get will be reloaded one with Loadonce*/

/* I would like to use a trace statement like 
_Loadonce[Trace] :: (If[Loadedp[$x],Pr["File $x loaded"],Pr["Loading $x"]];1)
but it won't work since trace will apply it after evaluating the loadonce
statement */
 
