DIRECTORY AmHerDict, AmHerDictRpcControl, Commander, IO, Rope USING [Length, ROPE], UserCredentials USING [Get]; AmHerDictTest: CEDAR PROGRAM IMPORTS AmHerDictRpcControl, Commander, IO, Rope, UserCredentials ~ BEGIN interface: REF AmHerDictRpcControl.InterfaceRecordObject _ NIL; dictionary: ATOM _ NIL; GetDefinition: PROC [cmd: Commander.Handle] RETURNS [result: REF _ NIL, msg: Rope.ROPE _ NIL] ~ { word: Rope.ROPE; commandLineStream: IO.STREAM _ IO.RIS[cmd.commandLine]; word _ IO.GetTokenRope[commandLineStream !IO.EndOfStream => CONTINUE].token; IF interface=NIL THEN interface _ AmHerDictRpcControl.ImportNewInterface[interfaceName: [instance: "DictServer"]]; IF dictionary = NIL THEN dictionary _ AmHerDictRpcControl.Dictionaries[interface, UserCredentials.Get[].name].first; IF word.Length[] # 0 THEN result _ AmHerDictRpcControl.GetDefinition[interface, word, dictionary ! interface.LispError => {cmd.out.PutRope["error in remote server: "]; cmd.out.PutRope[error]; cmd.out.PutChar['\n]; CONTINUE}].definition; IF result # NIL THEN { cmd.out.PutRope[NARROW[result, Rope.ROPE]]; cmd.out.PutChar['\n]; RETURN[$Success]} ELSE RETURN [$Failure]; }; Commander.Register[key: "Definition", proc: GetDefinition, doc: "retrieves definitions from the American Heritage Dictionary"]; END. NAmHerDictTest.mesa Edited by: John Maxwell April 16, 1986 3:22:59 pm Κ’˜Icode™K™2K™šΟk ˜ Kšœ ˜ Kšœ˜K˜ Kšœ˜Kšœœ œ˜Kšœœ˜K˜—KšΟl œœ˜Kšœ!œ˜Ašœ˜K˜Kšœ œ-œ˜?Kšœ œœ˜K˜šΟn œœœ œœ œœ˜aKšœ œ˜Kš œœœœœ˜7Kšœœ!œœ˜LKšœ œœ]˜rKšœœœ\˜tKšœœ½œ˜μšœ œœ˜Kšœœœ˜+Kšœ˜Kšœ ˜Kšœœ ˜—K˜—K˜K˜—K˜Kšœ˜—…—ξ