DoIt: Commander.CommandProc ~ {
effects: Creates a new CaminoReal expression viewer with label from command line.
local declarations
name: Rope.ROPE ← ""; -- label for viewer
filter all garbage characters out of command line for viewer name
FOR i:
INT
IN [0..cmd.commandLine.Length[] - 1]
DO
c: CHAR ← cmd.commandLine.Fetch[i];
IF c IN ['\040..'\176] THEN name ← Rope.Cat[name, Rope.FromChar[c]];
ENDLOOP;
IF name.Length[] = 0 THEN name ← "CaminoReal Expr";
[] ← ViewExpr.CreateCaminoItem[name, NIL];
};
Commander.Register[key: "Camino", proc: DoIt, doc: "Opens a new CaminoReal math expression editor viewer."];