File: Via54.mesa
Christophe Cuenod May 29, 1987 10:56:36 am PDT
DIRECTORY
Commander USING [CommandProc, Register],
Rope USING [ROPE],
FS USING [StreamOpen],
IO USING [card, Close, GetTokenRope, int, PutF, RIS, rope, STREAM];
Via54: CEDAR PROGRAM
IMPORTS IO, Commander, FS =
BEGIN
ROPE: TYPE = Rope.ROPE;
Via54Proc: Commander.CommandProc = BEGIN
i: CARD;
x, y: INT;
stream: IO.STREAMIO.RIS[cmd.commandLine];
outputName: ROPEIO.GetTokenRope[stream].token;
out: IO.STREAMFS.StreamOpen[outputName,$create];
IO.PutF[out, "4096 2048 -300 -375 200 5775 -100 -400 VIA54 PARC-VIA54 J\n"];
FOR i IN [1..54] DO
x← (i-1)/2*50;
y ← -(((i-1) MOD 2)* 36);
IO.PutF[out, "%g %g P%g 255 18 %g 0 32\n", IO.int[x], IO.int[y], IO.card[i], IO.card[i]];
ENDLOOP;

IO.Close[out];
IO.PutF[cmd.out, "File %g Written\n", IO.rope[outputName]];
END;
Commander.Register[
key: "Via54", proc: Via54Proc, doc: "Generates a Via54.part file\n"];
END.