Contents of the V.TXT file
V.C is a file viewer written to demonstrate how TCXL 5.5 can be used
in a real-world application. The program makes full use of TCXL's
new coding conventions. Its features include: a file-picking window;
four-way scrolling; searching (case-sensitive and case-insensitive);
settable tabs; goto line number; and on-line help.
V.Csource code for Turbo C/C++
V.ASCASCII text for help screens
V.HLPcompiled help screens
Usage: v [-tn] [filespec]
where n is the tab width for the file display. The filespec is
optional; if it is omitted, the user is prompted for a filename. If
the filename contains wildcards (? or *), or if the user presses
[Enter] or [Esc] without entering a filename, a file-picking window will
There is a help screen for each part of the program, accessible by
pressing [F1] at any time. Also, pressing [Alt-X] at any time
(except when viewing a help screen) will cause the program to quit.
When viewing a file, the following keys are active:
Esc/Alt-XQuit view window
HomeBeginning of file
EndEnd of file
UpArrowScroll up one line
DownArrowScroll down one line
LeftArrowScroll left one column
S-LeftArrowScroll left to first column
RighArrowScroll right one column
PgUpScroll up one screen
PgDnScroll down one screen
TabSet new tab width
F2Search again (using previous
search string and case-sensitivity)
V is fast and functional, but definitely has room for improvement in
several areas: it will only read as much of a file as it can allocate
memory for; also, it reads the file in all at once, so there is a delay
before you can navigate in the file. I intend to address this design
flaw in the near future.
Changes in version 1.01:
oTab-expansion handling has been fixed, so that long expanded lines
will never wrap or overwrite the window border (thanks to Ed Girou
for pointing this out).
oA command-line parsing bug has been fixed (if you used the '-v'
switch without an argument, bad things would happen).
Changes in version 1.02:
oI added validation to the function that gets a new tab setting from
the user; this fixes a bug that resulted if the user pressed Enter
in the empty input field (thanks to Ed Girou again--gettin'
to be a real nuisance there, Ed!).
oWhen I fixed tab expansion, I forget to apply the fix the the
function that displays a found search string; this is now fixed.
oFixed a bug that prevented the rightmost column in the
window to be used.
oFixed a bug related to horizontal scrolling.
oAnother change, not a bug fix, was to replace almost all calls
to Wputs() to Wprts(); since I'm doing my own tab expansion, I no
longer need the tab expansion (or any other translation) built
into Wputs(). Besides, Wprts() is smaller, presumably faster,
and eliminates the need to call Wgotoxy().
Changes in version 1.03:
oThe program now looks through the path to find the help file.
oUnix-style text files (LF instead of CR/LF) are now properly
oI added validation to the search prompt, so that the request
is ignored if the user Esc's out, or presses Enter in the
oI cleaned up the display of the line where found text is
oI changed horizontal scrolling a little so that the user can
always scroll to the right, just like LIST et al.
oVarious other cleanups, mostly ones that are invisible to
V was written by Dave Seidel. V.C and V.ASC are Copyright (c) 1990
David A. Seidel. V is freeware; you are welcome to use and
distribute these files as long as you don't charge any money for
them. I am interested in your feedback, code fixes, improvements,
etc. My CompuServe ID is [71511,2217]. You can send me Cmail, or
leave messages in PCVENC, section 6, or BPROGB, sections 3 or 5.