MODULE InfoLog;

	(*
	Write the filename as Link into the StdLog windows
	Helmut Zinn - 
	*)

	IMPORT
		Fonts, HostFiles, Ports, StdLinks, StdLog, Strings, TextCmds, TextModels;

	CONST
		pathLen = HostFiles.pathLen;
		underline = FALSE;

	PROCEDURE WriteLink* (IN path, filename: ARRAY OF CHAR);
		VAR
			attr: TextModels.Attributes;
			beg, end: INTEGER;
			cmd, msg: ARRAY pathLen + 32 OF CHAR;
	BEGIN
		cmd := "InfoCmds.OpenDoc('" + path$ + filename$ + "')";
		msg := path$ + filename$;
		StdLog.View(StdLinks.dir.NewLink(cmd));
		StdLog.String(msg);
		end := StdLog.text.Length(); beg := end - LEN(msg$);
		NEW(attr); attr.InitFromProp(StdLog.text.Prop(beg, end));
		attr := TextModels.NewColor(attr, Ports.blue);
		IF underline THEN attr := TextModels.NewStyle(attr, {Fonts.underline}) END;
		StdLog.text.SetAttr(beg, end, attr);
		StdLog.View(StdLinks.dir.NewLink(""));
	END WriteLink;

END InfoLog.
