98-07-02
Documentation for
~~~~~~~~~~~~~~~~~
VIEWS V2.01b3
~~~~~~~~~~~~~
This program is freeware. Copyright by Tobias Winkler.
No restrictions for PRIVATE use. Contact me before COMMERCIAL use!
I would like to hear, if you like this program, or have any comments
or ideas about it. (You can reach me per EMail or snail mail.)
EMail-addr: Obiwan@ComPorts.com
tobias_winkler@rocketmail.com
Home-page: http://www.comports.com/obiwan
Or via snail mail: Tobias Winkler
G.-Hauptmann-Str. 17
15234 Frankfurt (Oder)
Germany
_____________________________________________________________________________
Contents:
~~~~~~~~~~
.0) Legal Stuff :-/
.1) What is ViewS?
.1.1) Features
.1.2) Requirements
.2) Commandline of ViewS
.3) Statusbar of ViewS
.4) Messages
.5) Controls
.5.1) Keyboard-Usage
.5.1.1) Movement-Keys
.5.1.2) Temporarilly store/restore postions
.5.1.3) Permanently save/restore current text-position
.5.1.4) Searching for text-patterns
.5.1.5) Printing / Extracting selected lines
.5.1.6) Control wrapping of long lines
.5.1.7) Switching the display-mode
.5.1.8) CharConversion-/Attrib-Tables
.5.1.9) Miscellaneous keys
.5.2) Mouse-usage
.6) Searching
.6.1) 'Simple Patterns'
.6.2) Search options
.6.3) Wrapped search
.6.4) Case-tolerance and whole words
.6.5) Tolerant search
.6.6) Character conversion tables
.6.7) Line numbers after searching
.6.8) Searching and disk caching software
.6.9) Searching for 'Boolean Expressions'
.6.9.1) Tutorial about boolean expressions
.6.9.1.1) Subexpressions
.6.9.1.2) Quoting patterns
.6.9.1.3) Priority of operators
.6.9.1.4) Attributes of expressions/patterns
.6.9.1.5) The ANDS-operator
.6.9.1.6) Definition of ranges
.6.9.1.7) Abbreviations and short forms of keywords
.6.9.2) Boolean Expressions - short description
.7) Config-file
.8) Where to get the latest version?
_____________________________________________________________________________
.0) Legal Stuff :-/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This program is distributed without any warranty - without even the implied
warranty of merchantability or fitness for a particular purpose.
In other words, I am not liable for any damage that occurs through the use
or misuse of this program. You use it at your own risk.
If you don't agree - don't use it.
(But this doesn't mean, I'm not interested in bug-reports or not willing to
help... :)
ViewS is freeware.
You may use it free of charge for private usage. Contact me before commercial
usage.
You may distribute ViewS on any media as long as you distribute the full,
unmodified package without any fee, except a reasonable copying fee.
_____________________________________________________________________________
.1) What is ViewS?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ViewS is just a fileviewer mainly for textfiles, but also suitable for
browsing through raw binary data.
Unlike nearly all other viewers it doesn't scroll the display (text-)line
by line, but pixel by pixel which makes reading of long texts much more
comfortable. (This is called soft- or smoothscrolling - therfore the "S"
in ViewS. =)
While ViewS is running there is one line at the bottom of the screen,
showing the current status (see chapter .3) and the rest of the screen
is covered by the current text-part.
You control the program (scroll around, start searching,...) by some
(more or less intuitive) key-combinations (see chapter .5.1) or by mouse-
movement (chapter .5.2).
If ViewS want's you to notice something, there can be (info- or error-)
messages popping up below the status-line.
(see chapter .4)
____________________________________________________________________________
.1.1) Features:
- wrapping of long lines (at user-changeable width)
(optionally word-wrapping (which doesn't cut words) and
formatted wrapping, which keeps indentions)
- extremely fast searching for certain textpatterns
(case-tolerant and whole-word optional)
(I didn't found any program searching faster so far... )
- tolerant searching (more loose distribution of pattern's words)
- searching for boolean expressions (link patterns with boolean-
operators like AND, OR and NOT; use subexpressions; give each
expression a certain range like SameLine, SameChapter or SameFile
(and many more); optionally define wholeword- and casetolerance-status
for each pattern)
Example: Search for a chapter which contains (first) a line (which
contains the word "File" AND the word "open") AND (second)
the word "System".
(SameChapter (SameLine "File" and "open") and "System")
(don't worry, there are short forms for any of the keywords ;)
- little memory-needs, but can handle files up to a size of 2 GBytes
- store/restore current position (some kind of temporary bookmarks)
- save/load current position (permanently, but currently only one
position per file)
- any textmode which your BIOS supports or any textmode with
10 to 61 lines and 80 or 90 columns.
- print/extract whole text or just selected lines
(extracting can append or owerwrite existing files; your choice)
- read from StdIn (for piping DOS-output from other progs into ViewS)
- maaaannny user-changeable settings
- quite small standalone-executable (about 125KB currently)
(The executable (VIEWS.EXE) runs without any additional (supplemental) binaries.
When running it may create a data-file (VIEWSAV.DAT) for input-history and stored
positions (only if needed) in the same directory like the executable.
If you want to customize ViewS you need VIEWS.CFG and VIEWSCFG.EXE.
The rest of the package contains of documentation- and utility-files which are not
requested for running ViewS.)
(If you don't want to miss any feature of ViewS, better read the
HISTORY.TXT and/or the VIEWS.CFG, because I might have forgotten to
mention something here, or was to lazy, or didn't wanted to repeat
something already mentioned in the HISTORY.TXT, or a cute little worm-
hole suddenly appeared in the VIEWS.DOC (worm-holes are so strange,
they might even appear in such a virtual thing like a file...) and ate
some of the features, or hmmmmmmmm I don't know.... ;-)
____________________________________________________________________________
.1.2) Requirements
- 80286 or better (no need for original Intel ;)
(yes, 286-compatiblity is back...)
- DOS v3.3 or higher (absolutely no need for MS-products)
(an emulation may work too (Linux DOSEMU or WinNT DOS-Box) but could
have problems with the VGA-emulation)
- VGA-compatible graphics card
- a keyboard
(maybe even works without, but then you could miss some features ;)
- a mouse (optionally)
- about 200KB of free DOS-mem (doesn't use EMS, XMS or DPMI)
_____________________________________________________________________________
.2) Commandline of ViewS:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
( Symbols for commandline syntax description: )
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
( <> are just delimiters of commandline-elements and must not be used!)
( [] are just delimiters of optional arguments and must not be used!)
( | is just a divider for different allowed options/arguments,
thus it actually just means "or" and must not - ahhhm you know ;)
VIEWS []
Filename is (of course) the name of the file to read.
If filename is just an asterisk * ViewS will read from StdIn (Standard
Input - usually the console, but can be redirected - read your DOS manual)
to allow piping.
(Example: DIR | VIEWS *
or make a batch file (e.g. VMORE.BAT) which just contains 'VIEWS *'
and throw away your MORE-command: DIR | VMORE
(Atn: MSDOS (in opposition to NW/DRDOS) doesn't allow redirections to batch
files.)
)
Options have always a leading dash or slash (- or /) (like /? or -?).
Options are:
?|H : displays a short commandline reference
W[+|-] : enables '+' or disables '-' the linewrapping
(if no '+' or '-' is given, '+' is assumed)
Mt|f|r : sets the filemode to text- 't', filtered 'f' or Raw-mode 'r'
(Textmode is the normal mode for textfiles with
interpreting the CR,LF and Tab-codes.
Filtered textmode is like the normal textmode, but
all ASCII-codes below 32 (all "binary" codes) will
be filtered out.
In Rawmode all of these controlcodes are ignored, and
displayed as raw, linear character-stream. (Useful for
binary files.)
This mode can be changed while viewing (see below).
If this option isn't defined, the file-type (binary or
text) will be detected at startup. (at least tried ;)
C : loads the char-translation-table
(A char-translation-table is used, when reading a text
which is written on other systems than PC-DOS (like
Windoze or Amiga) and which contains non-standard-
ASCII-characters like "á...".)
(See config-file [ChrTab] / [DefChrTab])
A : loads the color-attribute-table named
(A color-attribute-table is used to highlight certain text-
passages like the *....* passages in Fido-messages.
(See config-file [AttrTab] / [DefAttrTab])
L : will move the screen to line number initially
O : will move the screen to fileoffset initially
(Both /L and /O assume the values to be decimal per default.
Values beginning with '0x' or '$', or ending with 'h' or
containing characters from 'A' to 'F' are considered hexa-
decimal.)
CM : this forces ViewS to use the current textmode (videomode)
(ViewS won't try to set it's standard videomode (as given
in VIEWS.CFG), but will accept the current settings.)
F : activate the selection cursor (see chapter .5.1.5) initially
(as if key had been hit)
(could be useful in conjunction with option /S...)
S[+|*] : write selected lines into file at exit:
/S+ will append to , if it
already exists,
/S* will overwrite , if it
already exists,
else
ViewS will ask you what to do, if it already exist
_____________________________________________________________________________
.3) Statusbar of ViewS:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At the bottom of the screen there is the statusbar of ViewS.
(Sorry, can't put it on the top of the screen, due to technical reasons.)
It looks like this:
ħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħ
ħLine: 1 - 24³T 1%³Col: 0şSpeed: 4ş Wrap şSelect 12 ùùùùùùħ
(1) (2) (3)(4) (5) (6) (7) (8) (9)
(1): Linenumber of first textline on screen.
(2): Linenumber of last textline on screen.
(3): Shows a red "T" for Text- and a red "R" for Raw-mode. (see commandline-
options /MT | /MR above for further information)
A red "F" means Filtered-text-mode (Key -) which filters out any
character below ASCII 32, which are all control-characters.
(4): The percent-value shows the current position in the file.
(5): Number of first shown column of the text.
(6): Current set scrollspeed, which can range from 1/99 (slowest) to 1/2
and 1 to 16 (fastest).
(The actual value is the number of lines (pixels, not textlines)
scrolled in each step. (Step is usually about 1/70 second.)
(See below => key-commands / config-file)
(7): Shows "NoWrap" if wrapping is disabled,
"Wrap" if line-wrapping is enabled and
"WordWr" if word-wrapping (don't cut words) is enabled.
(8): Counter showing the number of currently selected lines.
(Only shown, if any lines are selected.)
(9): Something like a speed-o-meter, which shows your current
"real" scrollspeed (and scrolldirection) with an equivalent
number of arrows. (just4fun)
"Behind" the statusbar there is a position-bar which shows the current
shown text-range (text-position) relative to the whole textsize.
("Behind" just means, it's shown via the background-color of the status-
bar.)
_____________________________________________________________________________
.4) Messages:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As stated above, there can be messages displayed below the statusline
sometimes.
They show events like errors, confirmations or requests, are color-
coded and produce (optionally) short PC-beeper-"sounds".
(You can toggle the sounds at run-time via - or disable them
permanently via the config-file.)
_____________________________________________________________________________
.5) Controls
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You may control ViewS and many of it's options by keyboard.
With a mouse you can scroll the text or exit from ViewS if you like.
Below (.5.1) there is a list with all keys and key-combinations ViewS
"understands" followed by descriptions of their functions.
Inputlines:
~~~~~~~~~~~
At some places in ViewS you are asked to enter a string (text).
(e.g. the searchpattern or a filename)
At these points you will get an input-line with most of the features you
may expect for comfortable input.
- you can move the cursor (with - / and )
- you can scroll the string if it doesn't fit into the inputline
- you can toggle between overwrite- (block-cursor) and insert-
(standard-cursor) mode (with )
(default is insert-mode)
- you can remove the character left from cursor with or
the character right from the cursor with
- crush-string option:
The input line may already contain some contents from previous use.
This old text is shown in different colors than your normal input
until you move the cursor for the first time since opening the input
line.
In this 'crush-mode' the old contents will be completely removed when
you enter new data or when you hit the or key.
If you just want to use the old text again, just hit .
To modify the old text, you will have to hit a 'non-modifying' key
(like the cursor-keys or ) first to cancel the crush-mode.
And if you want to enter new text, just type on, and the old text will
be replaced by the new data.
- inputline for filenames (or paths) allow you to hit for a 4DOS
like filename completion (read in chapter .6 'Filename completion)
- input-history which memorizes all your old input and allows you to
use it again later (open history list with or )
Input-history:
~~~~~~~~~~~~~~
Your input will be memorized only, if you confirm it with .
If you cancel with it won't be put in the history list.
Alternatively you can confirm with -, which will keep
your input from being memorized (as if [InputHistory] would be disabled).
When you hit or , a list will pop up which shows
all your previously used input.
That list has a cursor, which can be moved with -/,
, , or .
Select the data you want to use again and then hit or
to place it in the input-line where it will replace the old input, and
can be modified then.
This will also move the selected entry to the end of the history list
(can be disabled in VIEWS.CFG: [PromoteHistory] Off) and makes the
history list disappear.
If you want to remove an entry permanently from the history list,
select it and hit the -key. (There will be no confirmation-request.)
Cancel the history-list (and keep your old input) by hitting .
At the end of the list there is the newest entry, at the start
the oldest one. The cursor is at the newest entry (end of list) first.
(The list shows 4 items at a time only, but can be scrolled.)
There can be a maximum of 256 history-entries. (This number is just
chosen to keep the list at a reasonable size. Contact me, if you think
you need more entries.)
When exceeding this limit, the oldest entry will be removed before
adding a new one.
Keeping the history list clean (no duplicated entries):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you add a new entry to the list, there will be a check if there is
not already an identical entry in the list. If such an (obsolete) entry
is found, it will be removed before the new entry is added (at the end
of the list).
This can cause a short delay when adding a new entry, if your history
list is already quite long.
Therefore you can choose a different strategy for avoiding duplicated
(obsolete) history-entries via the [CleanHistory]-switch in VIEWS.CFG,
or disable any check for duplicated entries.
The standard setting is 'AddChk' (as described above).
The alternative would be 'ListChk' which will check for successive
identical entries when opening the history list. This could cause
a delay when opening the history list and you had added many identical
entries before, but in opposition to 'AddChk' there will be no delay
when adding new entries (while 'AddChk' has no delay when opening the
history list - you know...).
Just choose the behaviour you like more, or disable this feature
via [CleanHistory] Off if you don't mind having duplicated
entries in your list.
Some last facts about the history list :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The entire input-history feature can be disabled via
[InputHistory] Off (in VIEWS.CFG)
(in this case no inputhistory-information is stored; this is
for the security- or speed-concerned people :-)
By the way, the history-information is stored in VIEWSAV.DAT (in the
same directory as VIEWS.EXE) like the position-data (Key ...).
Inputlines for search-pattern/-expression and inputlines for file-
names use different history lists, so that the entries will show
up in their respective lists only.
____________________________________________________________________________
.5.1) Keyboard-Usage:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The most important key-combination: ;-)
Ctrl-Alt-Esc - This is the emergency exit. It should let you
stop the program at any point, even if it hangs.
("Hangs" means only: ViewS hangs in a buggy
routine of itself. If your system crashed, this
key-combination is useless.)
(Unfortunately this could make your system
instable afterwards. Reboot as soon as possible.)
___________________________________________________________________________
.5.1.1) Movement-Keys:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Up/Down - Scroll up/down.
Hold down the Shift-key to double the scroll-speed.
(For default, the actual scroll-speed won't jump
directly to the preset value, but the scrolling
will accelerate up to the desired speed. If the
key is released, the speed will slow down, until
zero is reached.
You can change this via the config-file as you
want.
See below => config-file)
Ctrl-Up/Down - Usually: Scroll up/down without soft-scrolling.
("Usually" means, when [HardScroll] in the config-
file is disabled. Else, -... will scroll
soft, and Up/Down without scroll hard.)
(See below => config-file [HardScroll])
Here you can hold down shift too, to speed up the
scrolling.
Left/Right - Move the screen left/right. (Changes the first shown
column.)
Ctrl-Left/-Right - Move the screen a half screen-width to the left/right.
Ctrl-Home - Reset horizontal position to 0.
PageUp/PageDown - Move the file around one page up/down.
("Around", because this works exactly at normal
25x80 textmode and when [PageAccel] (in config-file)
remains at it's default value of 16.
But in different textmodes (=> size of chars) or
different [PageAccel]-values, it can scroll a bit
less than a whole page/screen.
The reason for it is the acceleration/slowdown at
scrolling, which makes it hard to reach the wanted
position exactly.
)
Ctrl-PageUp/-PageDown - This moves up/down one page, but without accelera-
ting/slowdown. The position will directly (and
exactly) jump one page up/down.
This is a much faster way for scrolling through the
file.
(See below => config-file [HardPage])
Home - Move to the begin of the file.
("Pos1" on german
keyboards)
End - Move to the end of the file.
If you view a textfile (you are in Text-Mode; key
-), ViewS will move immediately to the end
of the file, and begins counting lines. The line-
counting is very fast, so you will only notice it
when viewing VERY large textfiles (above 4MB).
(At my system (K6-200, around 9,7MB/S raw-harddisk-
transferspeed) it needs 1 second for a 5MB-textfile.)
But that's no problem, because the line-counting
works completely in background, so that you can
still move, search or exit during the process.
ViewS will remember linenumber at certain file-
positions so that the delay of the count will
only happen the first time.
Tab/Shift-Tab - Moves the file 1 byte left/right.
(This could be useful for binary files, or such...)
Ctrl- || / || - Moves the file 16 bytes left/right.
Plus/Minus - This raises/lowers the scrollspeed.
It can range from 16 (fastest) down to 1.
Before scrollspeed 1 comes scrollspeed 1/2 down to
1/99 (slowest).
1..0 - This sets the scrollspeed directly from 1 to 10.
Ctrl-1..0 - This set scrollspeed from 1/2 to 1/20.
R - If you press this key, Reader's mode will be
activated/deactivated.
Reader's mode means, that Autostop (see below =>
Alt-A) is disabled, the speed is set to a predefined
value (default: 1/25 (can be changed in config-file))
and the text will immediatley begin to scroll down.
This is great, if you want to read a large text.
Simply test your prefered scrollspeed, adjusted
for you speed of reading (scrollspeed can still
be changed in the normal way), then set it perma-
nently via the config-file.
You can still stop movement/change movedirection
with Space and Cursor-Up/-Down.
(Space stops if scrolling, and continues scrolling
if stopped.)
The scroll-speed can temporarily boosted up by
holding down the cursor-key for current scroll-
direction. (Useful, if you want to skip a text-
passage.)
If you disable Reader's mode, the old speed value
and the old autostop-state will be restored and
the movement will stop.
Alt-A - Toggle autostop.
(If autostop is disabled, the movement won't stop
automatically at cursorkey-release, but only
if the cursorkey for the opposite direction or
is hit.
If you press the corresponding cursor-key, the
speed will be raised while holding this key.
)
___________________________________________________________________________
.5.1.2) Temporarilly store/restore postions:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Position-changes which tend to change your position in the text radically
(like Jump to text-begin/-end, search, ...) will put the old position in
a buffer from there it can be restored again.
(Each stored position get a number to be identified clearly.)
These positions are only temporarly remembered. If you leave ViewS they
get lost.
Alt-Up - Swaps current with previously stored position.
Alt-Left/-Right - Cycles through stored positions.
Alt-Down - Jump to the last stored position. (Useful to return when
you just scrolled through previously stored positions.)
If you are not at a stored position, this will just store
the current position.
P - Show all (numbers of) stored positions with current
position highlighted.
(Will show up too, everytime a position is (re-)stored;
at least, if [PosRestoreMsg] in VIEWS.CFG is enabled.)
Ctrl-P - Store current position to a certain "slot" (means number).
(or Ctrl-K) Will ask you for a number for the current position.
(This number is used to directly restore the position.)
Ctrl-G - Restore position from a certain slot.
(or Ctrl-Q) Ask which position number you want to restore.
(The secondary key-combos -/ are for you
Borland-IDE-users. :)
___________________________________________________________________________
.5.1.3) Permanently save/restore current text-position:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(Btw, all these functions not only save the current position, but
also the current filename to the savefile, so that you can store
different positions for different files...)
F10 - Save current position to savefile and exit
ViewS.
F2 - Save current position to savefile.
F3 - Restore saved position from savefile.
F8 - Remove the saved position from the savefile.
Ctrl-F3 - Restore any saved position from savefile, choosen
by a list. (Doesn't load the associated file, but
only the position. To jump to another file use
-.)
Ctrl-F8 - Remove any saved position from savefile, choosen
by a list.
Ctrl-F - Jump to a file choosen from a list of the savefile.
Ctrl-Alt -Left/-Right - Save current file to the savefile and
jump to the previous/next file (from savefile).
Ctrl-Alt -Up - Swap current file with previous loaded file.
Ctrl-Alt -Down - Jump to the original loaded file.
___________________________________________________________________________
.5.1.4) Searching for text-patterns:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See chapter .6 for further information on searching (like syntax of
boolean expression and other details).
S / F7 - Brings up a search window, where you can give a pattern
or a boolean expression, change some search options and
then start searching by hitting Enter.
You may also enter a filepattern (optionally inclusive
subdirectories) to search these files instead searching
inside the current one.
(See chapter .6.2 for more information about supported
wildcards in filepatterns.)
If you search the current file, searching begins in the
currently first shown line.
N / Shift-F7 - Searches for next occurrence of the pattern.
(Uses previous settings:
pattern, case-tolerance/-sensitivity,boolean-/-simple
search,...)
Shift-N - Searches for next occurrence of the pattern (like )
but centers the match (horizontally and vertically)
on the screen. (as if [CenterFoundForced] would be enabled)
Ctrl-N - Skip the current file, and continue searching in the next
file (if scanning multiple files).
Del - Hide found-marker. (Search-next (key ) will begin
at screen-top again.)
___________________________________________________________________________
.5.1.5) Printing / Extracting selected lines:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter - Toggle selection cursor on/off.
Cursor is moved around with /<-Down> and used to
select lines with or for extracting/printing.
Space / Ins - Toggle selection of line currently focused by the selection
cursor and move cursor down one line.
Ctrl-Del - Clear all selections. (Unselect all lines.)
Shift-W - Extract all selected lines into a (queryed) file.
If no line is selected, ViewS will ask you if
you want to extract/write the entire text.
(If you enter the filename, you may use a 4DOS like
filename completion. Just enter a part and hit .
Read in chapter .6 -> 'Filename completion' for more info
)
Shift-P - Print all selected lines. (If none selected will print
whole text.)
Lines are printed as you see them (with wrapping and
expanded tabulators).
The used printerport (LPTn) and the line-terminators
(CR/LF, CR, LF) can be choosen in the config-file.
___________________________________________________________________________
.5.1.6) Control wrapping of long lines:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If any wrapping is enabled, a line which is longer than a given length
(per default the screen-width) will be wrapped to the next screen-line.
Just line-wrapping will wrap the line when the length is exceeded, no
matter if any words are broken by doing so.
Word-wrapping will avoid broken words when wrapping. It will before the
word, if this is possible.
Formatted wrapping (added in ViewS v1.98) will try to keep indentions of
lines by beginning wrapped parts at the same position where the unwrapped
(first) part of the line began. (Begin means position of first non-white-
space character.) (Formatted Wrapping can be enabled/disabled in the
config-file, and is enabled by default. (Option [FormWrap]))
Alt-W - Toggle Line-Wrap.
W - Toggle Word-Wrap.
Shift-Left/-Right - Decrease/increase wrapwidth (max. length of
unwrapped line).
(hold for higher steps)
___________________________________________________________________________
.5.1.7) Switching the display-mode:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!! Warning:
!! These functions will change internal settings
!! of your VGA-card.
!! This could under very unusual circumstances
!! damage very old graphiccards or monitors.
!!
!! As far as I know, this can't happen with any
!! modern/current system, but
!! I WILL NOT BEAR RESPONSIBILITY FOR ANY PROBLEM
!! OR DAMAGE THIS PROGRAM CAUSES!
Alt-M - Switches to textmode with next higher number of
lines (lines: 10-61).
Shift-Alt-M - Switches to textmode with next lower number of
lines.
Alt-8 - Switch to textmode with 80 columns.
Alt-9 - Switch to textmode with 90 columns.
All these modes and any valid BIOS- or VESA-textmode
can be directly set in the config-file.
Ctrl-M - Choose textmode from the list.
Ctrl-Alt-S - Switch to next higher screen-frequency.
(VGA-cards have 4 different frequency-settings for each
videomode. This function will just cycle through them -
when hitting the last, it returns to the first.
So if your monitor behaves strange, just switch to a
lower frequency-setting, or press ESC to leave ViewS
(which will restore the old screen-settings).
)
___________________________________________________________________________
.5.1.8) CharConversion-/Attrib-Tables:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C - Select next char-conversion-table.
(See config-file [ChrTab] / [DefChrTab] for further info.)
Shift-C - Reset char-conversion-table. (-> use normal ASCII-table)
Ctrl-C - Select char-conversion-table from list.
A - Select next color-attribute-table.
(See config-file [AttrTab] / [DefAttrTab] for further info.)
Shift-A - Reset color-attribute-table. (-> no color-highlighting)
Ctrl-A - Select color-attribute-table from a list.
___________________________________________________________________________
.5.1.9) Miscellaneous keys:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ctrl-O or
Shift-F9 - 'Save Config'
Save the current state of all options/settings of ViewS
(into VIEWS.EXE).
Enable [AutoSaveCfg] in VIEWS.CFG to do this everytime you
exit ViewS.
(As this function does the same thing as VIEWSCFG.EXE, that
is writing the configuration data into VIEWS.EXE, but
doesn't change the actual config-file (VIEWS.CFG) itself,
these saved settings will be overwritten when you run
VIEWSCFG the next time.
)
L - Go to a new position, given by line number.
O - Go to a new position, given by offset.
G / F5 - Go to a new position, given by
line number if lines are shown in statusline, or
offset if offsets are shown in statusline.
(Toggled by Alt-L and Alt-T.)
(Values given for the 3 functions above are assumed to be
decimal per default. If they begin with '0x' or '$', or
end with 'h', or contain characters between 'A' and 'F',
then they are taken as hexadecimal.
You can make ViewS always assume hex. offsets (not lines)
by enabling [ForceHexOfs] in VIEWS.CFG.
)
Esc - Exit ViewS or cancel/leave current operation.
H / F1 - This pops up the helptext. If it is already visible
the helptext will jump to the next page.
Use Up/Down, to scroll helptext.
M - Show/hide last shown message.
Shift-R - Activate ruler.
The ruler will show it's length on screen (in chars),
it's length in the file (in bytes), the number of the
line it's currently in, it's start-offset and it's
end-offset.
: move ruler around on screen
Shift-: change ruler-size
+ / - : change ruler-size
Enter / ESC: leave ruler
Alt-T - Toggle filemode. (Toggles between text-, and raw- mode.)
(See above (Chapter .2) commandline-option /MT /MF and /MR)
Alt-F - Toggle binary-filter. (Will filter out binary codes. ( <32 )
Alt-C - Toggle mousecursor. (Show/hide mousecursor.)
Alt-L - Toggle statusbar-display between
linenumbers and line(-file-)offsets.
Alt-H - Toggle between soft- and hardscroll. (With hard
scrolling activated, -Cursorkeys will scroll
soft, and vice versa.)
Alt-P - Toggle position-bar. (See chapter .3)
Alt-S - Toggle (PC-beeper-)sound on/off.
Ctrl-B - Toggle background-display. (If enabled, screen-contents
not filled with file-contents is highlighted.)
Ctrl-T - Toggle tabulator-display. (If enabled, screen-contents
where Tabulators (ASCII 9) "jumped over" is highlighted.)
(Makes is easier to distinguish Tabulators from Spaces.)
Alt-K - Toggle the original keyboard-handler.
(ViewS uses it's own keyboard-interrupt-handler.
This means, that by default the old (system-)keyboard-
handler is "sleeping", so that (as a side-effect) you
can neither activate any keyboard-controlled TSR, nor
boot via Ctrl-Alt-Del.
You can make ViewS send keyboard-hits to the original
handler which will avoid that side-effect.
But this could maybe cause some (light) problems on
slower systems. Just try it; If there are problems
left it deactivated
)
Ctrl-R - Reread filebuffer/redraw the screen.
(This is more or less a useless debug-feature. ;-)
(Use it if the screen got somehow invalid.)
Ctrl-I - Toggle statusbar-display with internal debug-info.
____________________________________________________________________________
.5.2) Mouse-usage:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For default, vertical mousemovements (up/down) will change the speed,
while the speed is as higher as further the mousecursor is away from
the middle of the screen. Movement will stop, when the mousecursor is
around the screen-middle.
Horizontal movements (left/right) with left mousebutton pressed will
result in direct changes of the horizontal textposition (first shown
column). If you move the mouse to the left/right, the text will move
to the right/left.
The interpretation of mousemovements can be changed in many ways via
the config-file:
For vertical movement you can define:
- Analog mode , (the default, see above)
- Digital mode, where a certain distance from the screen-middle will
result in movement with normal scrollspeed (as if
cursorkey is pressed) (the scrollspeed doesn't depend
on distance to screen-middle, but is constant)
- No , which simply means, that vertical movements will be
ignored.
(See config-file [MsVertMode])
For horizontal movement available modes are:
- Absolute , where the horizontal position of the text directly
depends on the position of the mousecursor.
- Absolute Reversed, as Absolute, but mouse move to the left/right will
make the text move to the right/left.
- Relative , moves the text left/right as far the mouse was
moved left/right (after corresponding button was
pressed)
- Relative Reversed, as Relative, but left/right exchanged. (This is
the default mode.)
- No => horizontal movements will be ignored.
(See config-file [MsHorizMode])
Additionally the size of the zone at the screen-middle, where the vertical
movement will be stopped, can be set seperatly for Analog and Digital mode.
(See config-file [MsDistA] , [MsDistD])
You can define a button for vertical and another for horizontal movement,
which must be pressed for action. (Default: No button for vertical; Left
button for horizontal) (See config-file [MsVertBttn] , [MsHorizBttn])
And last but not least you can set the mouse-button(s) for exitting
ViewS. (Default: left and right button together)
(See config-file [MsEndBttn])
_____________________________________________________________________________
.6) Searching:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Searching in ViewS is really easy:
Just hit or , and a window will come up containing switches for
all the search options and a line for your input.
Just type in what you are searching for, hit and ViewS will begin
seeking through the text.
If you found some occurence of that what you wanted and then are looking
for the next occurence of it - just hit or -.
On the other hand you'll have to decide what you are searching for, and how
it shall be done.
Your choice will most likely depend on how exactly you know what you are
searching for, and how it appears - how it's written - in the text.
You can search just for a simple pattern or for a complex boolean expression.
(see chapter .6.1 about 'Simple patterns' and
chapter .6.9 about 'Boolean expressions')
Optionally patterns can be searched as whole words (won't be found if they
are part of another word) and as case-tolerant.
(see chapter .6.4 about case-tolerance and whole words)
For more search options read chapter .6.2 or the related part in VIEWS.CFG.
If you're searching for a pattern containing a group of words (like a part
of a sentence or alike) and you're not sure exactly how this group appears
in the text - all words could be on the same, but could also be distributed
on several lines; there could be space or some symbols or even other words
between them - then you can define how tolerant the search shall be.
(see chapter .6.5 about 'Tolerant search')
____________________________________________________________________________
Searching in multiple files
You may also input a filepattern (inclusive wildcards of course) and decide
if files in subdirectories shall be searched too.
The filepattern may use any DOS wildcards with some extensions.
The drive part may include wildcards too (searches any drive except A: and
B: and is aware of SUBSTed drives) and may also have multiple drives
assigned.
(e.g. *:\test.txt
c:h:e:\test.txt
*:a:b:\*.txt
)
The other extension to the DOS wildcards is the possibility to place an
asterisk '*' not only at the end of a name, but anywhere inside the
filename part of the pattern.
Means: If you'd use C*TEST.TXT in DOS, it would be treated as C*.TXT
while it works as expected in ViewS, and finds for instance
CTEST.TXT or CXYZTEST.TXT or C!TEST.TXT, but not CT.TXT and so on.
If you enter the name of a directory without wildcards following, then
ViewS will assume '*.*' as the filename part, and therefore search all
files in that directory.
(e.g c:\ will just search all files on drive C: )
____________________________________________________________________________
Filename completion
Last but not least the inputline for the filepattern supports a 4DOS-like
filename completion.
This means, you may just enter a part of a path and hit the key which
will replace that part with the first matching file.
Hit again to get the next match.
(By the way: Names of directories will be written in capital letters
(in opposition to filenames).
)
If no further matching file/directory is found, you'll hear a beep.
This function also trys to pay attention to wildcards you entered, and you
may of course edit the found path.
(Example: Enter 'C:\T'
hit -> 'C:\TEMP'
again -> 'C:\TEXT'
Add a backslash, and hit again
-> 'C:\TEXT\some.txt'
)
This function is supported in the inputline for the search-filepattern and
in the inputline for the targetfile of the 'Write Selection to' function.
____________________________________________________________________________
.6.1) Simple patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
First, a pattern is just something you can search for inside a text.
Could be a word, part of a word, a sentence, a part of a sentence, a group
of words... you know.
It's just a part of text, and can be indeed any combination of ASCII
characters - means: alphabetic letters, numbers or any symbols and so on.
If you want to know how to adapt the search more to your preferences then
read the following chapters.
____________________________________________________________________________
.6.2) Search options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The search window shows some switches which allow you to adjust the search
functions in some ways.
They can be changed by the shown key-combination (usually together
with some other key). (this is shown in square brackets below)
Following a list of them with some explanations:
* Search for a 'simple pattern' or 'boolean expression' [Alt-S]
(see chapter .6.1 about 'simple patterns' and
chapter .6.9 about 'boolean expressions')
'Simple Search' only:
~~~~~~~~~~~~~~~~~~~~~
* Tolerance level: [Alt-T] (see chapter .6.5)
'Boolean Search' only: (see chapter .6.9)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Keywords: Which kind of keywords are accepted. [Alt-K]
long+short forms, long forms only, short forms only
* Default range: [Alt-R]
can be: SameWord, SameFile, SameChapter, SameBlock, SameLine,
DistChars, DistWords, DistLines
* Default Dist: Distance value [Alt-D]
(only if 'Default range' is
DistChars, DistWords or DistLines)
Search preferences:
~~~~~~~~~~~~~~~~~~~
* Search case 'sensitive' or 'tolerant' [Alt-C]
(see chapter .6.4)
* Whole words only: 'Yes' or 'No' [Alt-W]
(see chapter .6.4)
* Wrap at file-end: 'Never', 'Always' or 'Ask' [Alt-E]
Continue searching at begin of file, when reaching end of file.
(see chapter .6.3)
How matches shall be shown:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Find same range 'every time' or 'once only' [Alt-O]
Mainly for boolean search, the setting 'once only' will match a
certain range (like a line or a chapter) one time only, even if it
meets the given condition on more than one point.
* Show full range: 'Yes' or 'No' [Alt-F]
When a range (line, chapter, ...) matches only because not containing
a negative pattern, you can decide if the whole full range shall be
marked as found (can get intricate for large ranges like SameChapter
or SameFile) or if only the last character of that range shall be
marked.
* Center Match 'if necessary' or 'always' [Alt-M]
You can decide, if the match shall be centered on screen only if it
is necessary, because it was outside the current screen, or if every
match shall be centered (like Shift-N).
The default value for these options can be changed permanently via the
settings in VIEWS.CFG or by storing them by hitting Ctrl-O (or Shift-F9)
(after leaving the search window).
____________________________________________________________________________
.6.3) Wrapped search
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can decide what's happening if searching hits the end of the file.
Per default it will ask you if it shall continue searching at the begin
of the file then (till the position where the initial search begun).
This way you can search the whole file, even if you began searching
somewhere else than at filebegin.
In VIEWS.CFG (option [WrappedSearch]) you can tell if it shall continue
at filebegin without asking you ([WrappedSearch] Always), or if searching
shall just fail at file-end ([WrappedSearch] Never).
____________________________________________________________________________
.6.4) Case-tolerance and whole words
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Case-tolerant means, that the search doesn't pay attention to the case of
the letters (e.g. searching for "Test" will find "test", "tEsT" or "TEST"
and so on).
Case-sensitive is the opposite to case-tolerant, and thus pay's attention
to a letters case.
(e.g. searching for "Test" will *only* find exactly "Test" and not "test"
or others).
Searching for 'whole words only' means that a place in the text will match
only if it's a complete whole word itself, and not part of another word.
(e.g. searching for "word" will only match "...word..." and not "...sword..."
not "...swordsman..." and not "...wordy...")
When you disabled the 'whole words only' option, then the word-boundary
won't get any attention.
Your pattern can be part of another word, but doesn't need to.
(in the example above, "word" would then find all the negative examples too)
____________________________________________________________________________
.6.5) Tolerant search
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For 'Simple Search' (not boolean search) you can define a tolerance level
from 0 to 6.
Level 0 is the exact search, which searches exactly for that pattern as you
wrote it, while level 1 to 6 allow a more 'loose' distribution of the words
contained in the pattern.
(It's no real 'fuzzy search' up to now - it doesn't find words with
different spellings.)
Tolerant search focusses mainly on the words contained in the pattern.
First it splits the pattern into the single words, and then defines what
is allowed between these words when analyzing the text.
A simple example would be searching for "just a test" (without the quotation
marks) in Level 1.
As Level 1 allows any NonWord-characters (symbols) between the single words
of the pattern, this would for example also find that pattern if
* it had been split by a linebreak:
..... just a
test ...
* or split by some other symbols:
.... just --- a --- test ....
* or (of course) split by a linebreak and some other symbols:
..... just --- a --
--- test ...
As you could see, the 'Tolerant Search' mainly takes the text as a stream
of words, divided by non-word characters. (A character is a symbol like
alphanumericals and other's.)
Word characters are the usual alphanumerical characters and some of the
high-ASCIIs (above ASCII 127) (just the characters which can form a word)
while non-word characters are just the rest.
(Linebreaks are also considered to be non-word characters.)
Higher tolerance levels usually allow just more loose distributions of the
words - they allow more 'other things' between the single words or allow
a different order of them.
They are also different in the way they split the pattern into the different
words.
* Level 1 requires the words in the pattern to be devided by at least one
Space (ASCII 32) and allows any number of non-word characters between the
words in the text (but no other _words_ between them).
* Level 2 is like level 1, but the pattern's words can be devided by any non-
word characters.
* Level 3 is like level 2, but additionally allows the text to have one other
word between the pattern's words.
* Level 4 is like level 3, but allows each of the pattern's words to be part
of another word.
* Level 5 is like level 3 (yes, level 3 and not level 4), but allows the words
to be in another order than in the pattern.
* Level 6 is like level 4, but allows another word-order, just like level 5.
Some examples:
~~~~~~~~~~~~~~
Imagine you're searching for "just non-word" then
Level 1 could find "just :) non-word"
Level 2 "just :) non+$%$%word"
Level 3 "just - another - non-word"
Level 4 "adjust : nonword"
Level 5 "word is just 'non'"
Level 6 "word is adjusted to 'non'"
(ehhm, don't try to find any sense in these examples ;)
Internally the tolerant search is handled by converting the pattern into
a boolean expression (dependent on the tolerance level) and using the
'Boolean Search' function then.
____________________________________________________________________________
.6.6) Character conversion tables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The character-conversion tables (key Ctrl-C) are currently not supported
during searching.
That means: if you search in a text from e.g. a Windoze-system, and
you search for a pattern which contains special characters (you know,
umlauts and so on) you will currently have to convert these
characters in the pattern yourself (use the related characters which
appear without the use of a conversion-table).
Later versions maybe will support searching in texts with different
codepages.
____________________________________________________________________________
.6.7) Line numbers after searching
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due to the characteristics of the used search algorithm ViewS can't keep
up to date with the line numbers when searching.
Thus if required, ViewS will automatically start counting the lines in back-
ground when searching ends.
This means, you nearly won't even notice that counting is in progress.
You can still do anything you want, only that the line numbers will show
just a question mark for one or two seconds (depends on the text size).
There will be a message showing the line number of the found place, right
when the counting is done.
(See info for -key, for more informations about line-counting.)
____________________________________________________________________________
.6.8) Searching and disk caching software
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As the file access of ViewS' search function is highly optimized and strictly
linear, the usual disk caching programs (like NWCache, SmartDrv...) will not
only show no effect, but even slow down searching by about 40% (depends on
your system).
Therefore ViewS will use the interface of some known caching programs to
temporarily disable their caching efforts, when it does a really big search.
ViewS can detect and disable:
* NWCache (of Novell's NWDOS 7.xx and Caldera's DR-OpenDOS 7+)
* SmartDrv (of MS-DOS 6+)
* PCCache (of ???)
After searching is done, the original cache-state (enabled or disabled) will
be restored of course, so this should be completely transparent to you.
You can define the size, which will be considered as "big" (for searching),
or completely disable this feature in VIEWS.CFG. (see [CacheOffSizeKB])
____________________________________________________________________________
.6.9) Boolean Expressions:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
First, if you are already familar with searching for boolean expressions, and
only need a description of the syntax and features, then read on in chapter
.6.9.2 please.
Else you should better read the following chapter.
_____________________________________________________________________________
6.9.1) Tutorial about boolean expression (just a try):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When searching for a boolean expression you will usually search for a certain
file, chapter or line (...) which meets your requirements.
This part of the text you are searching for is called 'range' in the
following.
The characteristics which you expect that range to have will usually be the
presence (or absence) of certain patterns.
And this is the big advantage 'boolean search' has over 'simple search'; you
don't search for just one static pattern, but for some patterns (words,
terms, ...) which are used in a certain range - where they form a context.
You will have to provide some patterns and link them with 'boolean
operators'.
The operators AND and OR just control under which condition the whole
expression shall match:
- when just one of the patterns is found - the OR-operator
or
- not before all patterns are found - the AND-operator.
This could be a nice point for an example:
(word1 AND word2) -> will match if 'word1' and 'word2' is found
(word1 OR word2) -> will match already if 'word1' or if 'word2' is found
(word1 OR word2 AND word3) -> will match if either 'word1' is found, or
if 'word2' and 'word3' is found
Now you need to define in which 'range' these linked patterns must be found.
Of course this is only important for AND-linked patterns, because all must
be found in this range, where OR-linked patterns doesn't care if and where
other patterns where found.
The range must be defined by putting the respective keyword at the begin of
the expression.
There are 2 different kinds of ranges:
The first requires all patterns to be in the same file, chapter, block,
line, or word.
(keywords: SAMEWORD, SAMELINE, SAMECHAPTER, SAMEBLOCK, SAMEFILE)
The other kind focuses on the distance between two successive matching
patterns. You define a certain number of characters, words or lines which
are allowed to be between them.
(keywords: CHARDIST, WORDDIST, LINEDIST
followed by an _optional_ colon ':' or equalsign '=' and the number)
Again some examples:
(SAMELINE word1 AND word2) -> matches only if a line is found, which
contains 'word1' and 'word2'
(WORDDIST=2 word1 AND word2) -> matches only if 'word1' and 'word2' is found
with max. 2 other words between them
-----------------------------------------------------------------------------
Now, these were the basics of boolean search.
If you understood them and want to use some of the advanced features,
read on.
By the way, all of the keywords are _not_ case sensitive. You can use
AND, And, and, aNd - whatever.
Keywords must be terminated by a space (ASCII 32) or any other recognized
symbol (like the quotation mark, a bracket or one of the abbreviation-
symbols (see chapter .6.9.1.7 'Abbreviations...'))
_____________________________________________________________________________
.6.9.1.1) Subexpressions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can not only use patterns, linked by boolean operators, but also complete
other expression - which became then 'subexpressions' of the expression they
form - their 'parent'.
To do so, just use boolean expression enclosed in brackets.
Examples:
(SAMECHAPTER word1 AND (SAMELINE word2 AND word3))
-> Chapter which contains 'word1' and
a line which again contains 'word2' and word3.
(SAMELINE word1 AND (WORDDIST=1 word2 AND word3) OR word4)
-> Line which contains 'word1' anywhere and either 'word2' and 'word3'
with a maxumium distance of 1 word, or just 'word4'.
This allows you to create real complex expressions if you want.
There is no limit on the complexity except the memory-limit and currently
a maximum for the complete term lenght of 255 characters.
The subexpressions are completely independent from their parent, except that
their range will never exceed their parent's range.
Means, if you e.g. would use the second example above, then 'word2' and
'word3' must be in the _same line_, although the WORDDIST=1 wouldn't require
that - but the SAMELINE from the parent does so.
Default settings:
~~~~~~~~~~~~~~~~~
A sub-expression always inherits all settings from it's parent, although
they can be overridden.
E.g. in (WORDDIST=1 word1 and (word2 and word3)) the outer expression has
a range of WORDDIST=1 and the inner one inherits this range, until it gets
an own range-keyword.
This is valid for case-tolerance (see .6.9.1.4 'Attributes...') and range
definitions.
The outermost expressions - the one without a parent - inherits the default
settings from the search window.
Currently the 'whole word' setting from the search window needs some caution:
As the syntax doesn't allow to disable the 'whole word' attribute and
defining an entire expression as 'whole word' (of course would concern
only contained patterns, not the expression as unit) isn't supported
currently, the 'whole word' setting from the search window _GLOBALLY
CONCERNS ALL PATTERNS_ if enabled.
If you enabled that switch, you can't disable it - not locally and not
globally - in the expression itself. But if it's disabled, you can define
single patterns as 'whole word'.
(I'll probably change this behaviour later...)
_____________________________________________________________________________
.6.9.1.2) Quoting patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As you could see already, there are some reserved words and symbols, which
won't be recognized as patterns, but as commands.
(Words like the boolean operators AND and OR, the range keywords like
SAMELINE and others or symbols like the brackets, Space and others.)
(See .6.9.1.7 'Abbreviations...' for a complete list.)
If you want to use such reserved words/symbols in your patterns, you will
have to define clearly begin and end of that pattern.
To do so, you will have to put your pattern inside double quotation marks "".
(e.g. "this is just one pattern" )
If a pattern shall contain the quotation mark itself, you will have to use
it twice in a row in the quoted pattern (to avoid misinterpretation as
'end of quote).
( e.g. "searching for ""a quote"""
will find '...searching for "a quote"...' )
_____________________________________________________________________________
.6.9.1.3) Priority of operators
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The AND-operator has an higher priority than the OR-operator.
This means, if you mix AND- and OR-operators in one expression, successive
AND-linked patterns/subexpressions will be handled like a unit, like an own
independent subexpression.
(It's like the precedence of multiplication/division before addition/
subtraction in arithmetics...)
(e.g. (word1 OR word2 AND word3)
handled the same way as (word1 OR (word2 AND word3))
but different to ((word1 OR word2) AND word3)
)
_____________________________________________________________________________
.6.9.1.4) Attributes of expressions/patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patterns and subexpression can have certain attributes assigned.
They are usually defined by their respective keywords in front of the
pattern/subexpression.
(The 'whole word' attribute is an exception - but see below.)
Although all these keywords can be used in conjunction with subexpressions
too the only one which really concerns patterns _and_ expressions, is the
NOT (negative) keyword.
All other keywords, used in front of subexpressions, just define the default
settings of the patterns inside that subexpression.
(Hmm, maybe 'all other keywords' is a bit exaggerated - there are currently
only two other keywords, both controlling the 'case tolerance' state.)
The NOT-keyword:
~~~~~~~~~~~~~~~~
NOT just defines a pattern or expression as negative, as not wanted.
This means, that it _must not_ be found in the related range to match it's
requirements - to match the expression.
An example:
(SAMELINE word1 AND NOT word2)
will only find these lines, which contain 'word1' but not 'word2'.
The lines which contain not 'word1' or which _do_ contain 'word2' will
not match.
(SAMELINE word1 OR NOT word2)
will match if the line contains 'word1' or also if the line does not
contain 'word2'.
It will always match, if 'word2' is not contained or if 'word1' is found.
The CASET/CASES -keywords:
~~~~~~~~~~~~~~~~~~~~~~~~~~
CASET and CASES define, if a pattern/the patterns in a subexpression shall
match only textparts matching exactly their case (CASES - CASESensitive) or
already if the same letters - no matter what case - are found (CASET -
CASETolerance).
Example:
CASET word will match 'word', but also 'Word', 'WORD', 'wOrD' and so on.
CASES word will match 'word', and only 'word'.
The 'whole word' -attribute:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This attribute is special in that way, that it won't be assigned by a key-
word, but just by enclosing a _single_ pattern with brackets.
(I wanted to keep the number of reserved words low, and think that brackets
are somehow a fitting metaphor for word boundaries. ;-)
Thus, if you want to make sure that a pattern is found only if it's an own
seperate whole word, then just enclose it with brackets.
(Other attributes for this pattern - CASET, CASES, NOT - can be placed
inside the brackets or in front of them.)
Example:
word will find 'word', but also 'sword', 'swordsman' an so on.
(word) will only find '...word...', but not 'sword' or 'swordsman'.
A textpart is considered to be a 'whole word', if there is no word-building
character before and after it.
Considered as 'word-building' are all alphanumerical characters and most of
the high ASCIIs - characters with a ASCII code above 127 - which includes
umlauts and other language specfic letters from codepage 437.
(If you urgently need support for other codepages too, contact me.)
_____________________________________________________________________________
.6.9.1.5) The ANDS-operator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is a special form of the AND-operator: the ANDS-operator.
(The 'S' stands for sequential.)
This operator works just like the AND-operator, but in opposition to AND,
ANDS requires the patterns/subexpressions to appear in the same order -
the same sequence - as they appear in the expression.
Example:
(word1 ANDS word2 ANDS word3) will only find '...word1...word2...word3...'
while
(word1 AND word2 AND word3) would also find '...word2...word1...word3...'
and so on.
If a pattern appears in the 'wrong place', this will _not_ invalidate the
whole expression, but it will just be ignored. It still can appear again
at the right place.
Therefore:
(word1 ANDS word2 ANDS word3)
can also find '...word1...word3...word2...word3' and so on.
^^^^^
will just be ignored
_____________________________________________________________________________
.6.9.1.6) Definition of ranges
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As already said above, the range-keywords define in what range all AND-linked
expressions must match and what range is invalidated by negative expressions.
These keywords must be placed at the very beginning of an expression,
normally directly after the opening bracket starting the expression.
Ranges of the first kind are:
SAMEWORD, SAMELINE, SAMECHAPTER, SAMEBLOCK and SAMEFILE.
SAMEWORD and SAMEFILE should be selfexplaining.
SAMECHAPTER is also clear I think; Maybe I should mention, that the end of
a chapter is recognized by an empty line (an empty line may contain white-
spaces like Space (ASCII 32) or Tabulators (ASCII 9)).
SAMEBLOCK ... A block is like a chapter, but it's not terminated by an
empty line, but by a line beginning with at least 8 of the following
characters (symbols): #%-*/(=~ÄÍÛÜß°ħ²
(Whitespaces at the line-begin (before the other symbols) are allowed.)
Example for such a line: '--------This is a blockend-------'
Such blocks are often found in text lists like Ralf Brown's great Interrupt
List.
Another kind of ranges are the DIST-ranges. They define the maximum distance
which is allowed between two matching expressions.
(Example: (WORDIST=1 word1 AND word2)
will match: 'word1 one word2' or 'word1 word2' or 'word1word2'
but not : 'word1 one two word2' and so on...
)
This distance can be defined in
characters (actually bytes...): CHARDIST ,
words; WORDDIST ,
or lines: LINEDIST.
CHARDIST is clear so far, but don't forget that it doesn't interpret the
characters; thus a Tabulator just counts 1 char, and a line-break usually
counts 2 chars.
WORDDIST should be clear anyway.
To see a definition of 'word', read the 'whole word' explainations in
chapter .6.9.1.4 'Attributes...'.
LINEDIST simply allows some lines between matching expressions.
(e.g. LINEDIST=0 will allow successive matches in the same or in one and
the next line.)
The distance value must be given directly after the keyword (e.g. WORDDIST12)
or after an optional colon or equal sign (e.g. WORDDIST:12 WORDDIST=12)
_____________________________________________________________________________
.6.9.1.7) Abbreviations and short forms of keywords
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For any of the keywords exist a long and a short form.
You can allow the use of both forms or only one kind if you want.
Either change this in the search window, or permanently in the config file.
If you want to change the keywords, then you can do so in the config file.
long form: short form:
~~~~~~~~~~ ~~~~~~~~~~~
AND +
ANDS &
OR ,
NOT !
CASET ^
CASES ^^
SAMEWORD SW
SAMELINE SL
SAMECHAPTER SC
SAMEBLOCK SB
SAMEFILE SF
CHARDIST CD
WORDDIST WD
LINEDIST LD
Some examples:
~~~~~~~~~~~~~~
SC (SL ^^("file")+open)+system
- chapter which contains a line (line containing "file" (exactly
and as a whole word) and "open" (case-tolerant))
and the word "system" (case-tolerant)
SF (SC ("find","read")+"me")+!(sc(wd=2 ("don't")&("find")&("me")))
- match the whole file if it contains a chapter (containing "me" and
("find" or "read")) but the file must not contain a chapter (where
the (whole-)words "don't" and "find" and "me" appear (in that special
order) with maximum 2 other words between them)
^^("JustATest")
- just find exactly the (whole-)word "JustATest" (case-sensitive)
_____________________________________________________________________________
.6.9.2) Boolean Expressions - short description
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(short forms of keywords are in square brackets behind their long form)
* keywords are not case-sensitive
* keywords must be terminated with a space or another reserved symbol +&,!"()
OPERATORS:
~~~~~~~~~~
* Expressions can be combined by the following operators:
AND [+]
ANDS [&] (sequential AND)
OR [,]
* ANDS will (in oposition to AND) pay attention to the order in which
the expressions match.
(1+2 will match '21', 1&2 will not match '21')
* AND and ANDS have priority over OR.
* sub-expressions are enclosed in brackets () Example: (1+(2,3))
* negative expressions (and patterns) are defined by the prefix
NOT [!]
* negative expressions must not match (must not be found) to make
their parent match
* NOT also negates itself, thus NOT NOT is the same as a non-negative
PATTERNS:
~~~~~~~~~
* enclose pattern in quotation marks (") to avoid interpretation of
patterns with reserved words/symbols
* a single quotation mark (") in a quoted pattern is represented by two
quotation marks ("")
(e.g. "quoted: ""test""")
* put a single pattern in brackets, to search for it as 'whole word'
(e.g. ("word") or (word) )
* the default setting ([DefWholeWord]) from VIEWS.CFG will be valid
for any given pattern, and can not be overridden if *enabled*.
(Will be changed in future versions.)
* use before a pattern or expression:
CASET [^] to define a pattern or all patterns in an expression as
case-tolerant
CASES [^^] to define a pattern or all patterns in an expression as
case-sensitive
* use before a pattern to override the default status from parent
expression
* the highest expression (which contains all other expression) will use
the default setting ([DefCaseT]) from VIEWS.CFG
RANGES OF EXPRESSIONS
~~~~~~~~~~~~~~~~~~~~~
* each expression has a valid range in which all it's patterns/subexpressions
must be fulfilled to make it match
* there are 2 types or ranges
* SAME... - requires all sub-expressions to match inside this range
SAMEWORD [SW]
SAMELINE [SL]
SAMECHAPTER [SC]
SAMEBLOCK [SB]
SAMEFILE [SF]
* end of SAMECHAPTER is recognized by an empty line
(empty lines may contain white-spaces)
* end of SAMEBLOCK is recognized by a line optionally starting with
whitespaces and at least 8 chars out of #%-*/(=~ÄÍÛÜß°ħ²
(Example: '--------End of Block--------')
(useful for lists like Ralf Brown's INTLIST)
* ...DIST[:|=]
- requires distance between two matched sub-expressions
be equal or lower than
CHARDIST [CD]
WORDDIST [WD]
LINEDIST [LD]
* the distance-value is either given directly behind the keyword, or
after an optional colon (:) or equal sign (=)
(Examples: (WD10 1+2) (WD=10 1+2) (WD:10 1+2)
* CHARDIST is not interpreting control-codes
--> Tab (ASCII 9) counts 1 char; Linebreaks usually count 2 chars
* if no range is given, the range from the next higher expression (the
parent) will be used
* the highest expression (which contains all other expression) will use
the default setting ([DefRange]) from VIEWS.CFG
* Syntax reference of boolean expression (EXP):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOP = []
VALUE = just a decimal value
string= just a string ;)
EXP = [ EXP OP EXP | ATTR EXP | (RANGE EXP) | PATTERN ]
OP = [ 'and' | '+' | 'ands' | '&' | 'or' | ',' ]
ATTR = [ 'not' | '!' | 'caset' | '^' | 'cases' | '^^' ]
PATTERN = [ '"' STRING '"' | STRING ]
RANGE = [ NOP | RANGE_SAME | RANGE_DIST RANGE_DIVIDER VALUE ]
RANGE_SAME = [ 'sameword' | 'sw' | 'sameline' | 'sl' | 'sameblock' | 'sb' |
'samechapter' | 'sc' | 'samefile' | 'sf' ]
RANGE_DIST = [ 'chardist' | 'cd' | 'worddist' | 'wd' | 'linedist' | 'ld' ]
RANGE_DIVIDER = [ NOP | ':' | '=' ]
* I know it's not 100% perfect, but I'm just much to lazy...
* last but not least: you can change any keyword/symbol and the default
settings in VIEWS.CFG
_____________________________________________________________________________
.7) Config-file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many features of ViewS can be adjusted by it's config-file VIEWS.CFG
which must be "compiled" (transfered into binary form into VIEWS.EXE)
by VIEWSCFG.EXE.
(I decided to "compile" VIEWS.CFG by VIEWSCFG.EXE, because interpreting
the text-config-file directly by ViewS itself would increase the size
and startup time of VIEWS.EXE itself.)
If you change VIEWS.CFG and forget to compile it with VIEWSCFG.EXE,
the current version (in opposition to older ones) will *no* longer give
you a warning-message, because that check also caused a slowdown on
system's without a disk-cache.
(Maybe I will make that behaviour user-changeable in the future.)
For further information, please read the VIEWS.CFG (text-)file where
every option is documented.
_____________________________________________________________________________
.8) Where to get the latest version?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Just visit the ViewS-homepage: (what a waste of bandwith :-)
http://www.comports.com/obiwan (it's a netforward-redirector to a
GeoCities-Page currently)
There you'll find the last release of ViewS, the newest beta-version and
some other stupid stuff... just give it a try.
I'll also upload new versions of ViewS to the great Simtel-Archive. Look at
ftp.simtel.net/pub/simtelnet/msdos/txtutl/
or a Simtel-mirror near you.
The filename will always be VIEWSxxx.ZIP, where xxx is the version-number
(e.g. VIEWS199.ZIP).
If you don't have access to the INet, just contact me, and we'll see, how
to manage it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So, that's all for now. THNX for listening :-).
Bye,
TW.
PS. I'm absolutely not sure about the 'Boolean Expression' chapter.
Seems like I'm not able to explain things short and simple...
...I can't make it better, but if you think *you* can...
... I'm open for any suggestions or better versions. :)
               (
geocities.com/siliconvalley/sector/5552)                   (
geocities.com/siliconvalley/sector)                   (
geocities.com/siliconvalley)