DIRECTORY Commander, CommandTool, IO, List, Rope; CmdTest: CEDAR PROGRAM IMPORTS Commander, CommandTool, IO, List ={ ROPE: TYPE = Rope.ROPE; regDir: ROPE _ CommandTool.CurrentWorkingDirectory[]; Answerback: PROC [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL] --Commander.CommandProc-- = { s: IO.STREAM _ IO.RIS[cmd.commandLine]; result _ s.GetRefAny[]; msg _ s.GetLineRope[]; s.Close[]; }; ShowResult: PROC [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL] --Commander.CommandProc-- = { result _ List.Assoc[$Result, cmd.propertyList]; msg _ IO.PutFR["previous Result = %g", IO.refAny[result]]; }; ResultOf: PROC [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL] --Commander.CommandProc-- = { result _ CommandTool.DoCommand[cmd.commandLine, cmd]; msg _ IO.PutFR["Result = %g", IO.refAny[result]]; }; Start: PROC = { Commander.Register[key: "Answerback", proc: Answerback, doc: "reads result and msg from command line (uninterpreted)", interpreted: FALSE]; Commander.Register[key: "ShowResult", proc: ShowResult, doc: "tells Result of previous command"]; Commander.Register[key: "ResultOf", proc: ResultOf, doc: "executes command and tells Result", interpreted: FALSE]; }; Start[]; }. vCmdTest.Mesa Last Edited by: Spreitzer, May 6, 1985 9:29:04 pm PDT Mike Spreitzer June 19, 1986 6:31:40 pm PDT Κ°– "cedar" style˜code™ J™5K™+—K˜KšΟk œœ ˜1K˜šΠbxœœ˜Kšœœ˜(K˜K˜K˜Kšœœœ˜K˜Kšœœ)˜5K˜šΟn œœœ œœœœœΟcœ˜wKš œœœœœ˜'K˜K˜K˜ K˜—K˜šŸ œœœ œœœœœ œ˜wKšœ/˜/Kšœœœ˜:K˜—K˜šŸœœœ œœœœœ œ˜uKšœ5˜5Kšœœœ˜1K˜—K˜šŸœœ˜Kšœ„œ˜‹Kšœa˜aKšœkœ˜rK˜—K˜K˜K˜K˜——…—τ