The reason things are all out of whack
when you view with the PageFile command is because of the default
font being used for the display - it is a proportional font instead
of a fixed width font (like Courier). This can be changed:
- Define a font in your project that is something like Courier
(or some other fixed width font), 12, White for the foreground
color.
- Create a Cicode library in the project, the name doesn't matter
as long as it's 8 characters or less, no spaces or special
characters. Put the following functions in the library:
FUNCTION
MyPageFile(string sFile = "")
IF PageDisplay("File") THEN
PageDisplay("!File");
END
DspFile(21, DspFontHnd("YourFontName"), 24, 95);
DspFileSetName(21, sFile);
END
FUNCTION
MyTextFileRun(INT hAn = 21)
IF StrToInt(PageInfo(7)) = 0 THEN
DspFile(hAn,
DspFontHnd("YourFontName"), 24, 95);
END
END
Replace YourFontName with whatever you named your font, but keep
it in quote marks.
- Open the !file page in your project, choose Edit|Break Lock
Mode, then Edit|Select All, then Edit|Cut Link. Double-click on the
f(x) at the start of the file display area and replace the
TextFileRun command with your MyTextFileRun command, keeping the
argument the same.
- On the button you use to call the PageFile command (or the
keyboard command), replace PageFile("File path and name") with
MyPageFile("File path and name"). Save the changes and run.
|