CDStarter.mesa (part of ChipNDale)
Copyright © 1983, 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, November 7, 1983 5:39 pm
last edited Christian Jacobi, September 3, 1985 11:37:30 am PDT
DIRECTORY
CommandTool,
Process,
Rope,
TerminalIO,
UserProfile,
ViewerClasses,
ViewerOps;
CDStarter:
CEDAR
PROGRAM
IMPORTS CommandTool, Rope, TerminalIO, UserProfile, ViewerOps = --, Process =
BEGIN
StartPrograms:
PROC[] =
BEGIN
runList: LIST OF Rope.ROPE = UserProfile.ListOfTokens[key: "ChipNDale.RunPrograms"];
FOR l:
LIST
OF Rope.
ROPE ← runList, l.rest
WHILE l#
NIL
DO
IF
NOT Rope.IsEmpty[l.first]
THEN {
msg: Rope.ROPE = CommandTool.Run[bcdName: l.first].errMsg;
IF msg#NIL THEN TerminalIO.WriteRope[msg];
}
ENDLOOP;
END;
TrojanHorse: PROC[] =
BEGIN
trojanHorse: Rope.ROPE = "/Cedar/ChipNDale/6.0/cd21/CDTroja";
TRUSTED {Process.SetPriority[Process.priorityBackground]};
[] ← CommandTool.Run[bcdName: trojanHorse];
END;
MoveTerminal:
PROC[] =
BEGIN
v: ViewerClasses.Viewer ← ViewerOps.FindViewer["Terminal"];
IF v#NIL THEN ViewerOps.ChangeColumn[v, right];
END;
StartPrograms[];
IF UserProfile.Boolean["ChipNDale.TerminalStartRight", TRUE] THEN MoveTerminal[];
TRUSTED {Process.Detach[FORK TrojanHorse[]]};
END.