MODULE Show; (* Procedures to display a single line of text relative to the current point. All procedures in this module require that the current point is defined. *) IMPORT PS; PROC L(txt) IS VAR p, w IN p := PS.CurrentPoint(); w := PS.StringWidth(txt); PS.Type(p, txt); PS.MoveTo((CAR(p) + w, CDR(p))) END END; UI TextTool(L); (* Types "txt" left-justified off the current point, then moves the current point to the right by the width of "txt". *) PROC C(txt) IS VAR p, w IN p := PS.CurrentPoint(); w := PS.StringWidth(txt); PS.Type((CAR(p) - w / 2, CDR(p)), txt) END END; UI TextTool(C); (* Types "txt" centered about the current point. This procedure does not change the current point. *) PROC R(txt) IS VAR p, w IN p := PS.CurrentPoint(); w := PS.StringWidth(txt); p := (CAR(p) - w, CDR(p)); PS.Type(p, txt); PS.MoveTo(p) END END; UI TextTool(R); (* Types "txt" right-justified off the current point, then moves the current point to the left by the width of "txt". *)