VAX-11 Screen-Oriented Browsing Program BROWSE ---------------- October 27, 1995 ---------------- This manual documents BROWSE, a file browsing utility Copyright 1995 by Thomas E. Dickey Page iii CONTENTS CHAPTER 1 INTRODUCTION TO BROWSE 1.1 SPECIAL FEATURES . . . . . . . . . . . . . . . . . 1-1 1.2 COMMAND ENTRY . . . . . . . . . . . . . . . . . . 1-1 1.3 SEARCHES . . . . . . . . . . . . . . . . . . . . . 1-2 1.4 SCREEN ORGANIZATION . . . . . . . . . . . . . . . 1-3 1.5 CONFIGURATION REQUIREMENTS . . . . . . . . . . . 1-10 CHAPTER 2 BROWSE COMMANDS 2.1 SCROLLING COMMANDS . . . . . . . . . . . . . . . . 2-1 2.1.1 Forward/Backward . . . . . . . . . . . . . . . . 2-1 2.1.2 Aborting A Scrolling Operation . . . . . . . . . 2-2 2.1.3 Left/Right . . . . . . . . . . . . . . . . . . . 2-2 2.1.4 Column And Line Display . . . . . . . . . . . . 2-3 2.2 SEARCHING . . . . . . . . . . . . . . . . . . . . 2-4 2.2.1 Initiating A Search . . . . . . . . . . . . . . 2-4 2.2.2 Continuing A Search . . . . . . . . . . . . . . 2-4 2.2.3 Aborting A Search . . . . . . . . . . . . . . . 2-5 2.3 ALTERING THE DISPLAY FORMAT . . . . . . . . . . . 2-5 2.3.1 Overstrikes . . . . . . . . . . . . . . . . . . 2-5 2.3.2 Marks And Record Numbers . . . . . . . . . . . . 2-5 2.4 OTHER COMMANDS . . . . . . . . . . . . . . . . . . 2-6 2.4.1 Exiting From BROWSE . . . . . . . . . . . . . . 2-6 2.4.2 Help-Screen . . . . . . . . . . . . . . . . . . 2-7 2.4.3 Screen-Refresh . . . . . . . . . . . . . . . . . 2-7 2.4.4 Screen-Dump . . . . . . . . . . . . . . . . . . 2-8 2.4.5 Version . . . . . . . . . . . . . . . . . . . . 2-8 CHAPTER 3 INVOKING BROWSE APPENDIX A COMMAND SUMMARY Page iv PREFACE MANUAL OBJECTIVES This manual describes the screen-oriented browsing program BROWSE and provides usage and reference information on the program. INTENDED AUDIENCE This manual is intended for users of the VAX/VMS operating system who must manage disk files. Users are expected to be familiar with the VMS directory structure. STRUCTURE OF THIS DOCUMENT This manual contains three chapters and one appendix. o Chapter 1, Introduction to BROWSE, provides an overview of BROWSE, and describes screen manipulation and command entry. o Chapter 2, BROWSE Commands, describes the keystroke commands which BROWSE processes. o Chapter 3, Invoking BROWSE, explains how to run BROWSE and describes all of the command line qualifiers. o Appendix A, Command Summary, describes all BROWSE commands in a short, concise form. CHAPTER 1 INTRODUCTION TO BROWSE The BROWSE program permits you, the user, to browse a VMS file, scrolling up, down, left or right. By using cursor- and screen-update optimization, BROWSE provides you with rapid response. BROWSE is superior to the EDT screen editor for applications which require examination, rather than modification. 1.1 SPECIAL FEATURES Besides the basic scrolling functions, BROWSE provides you with other powerful screen-oriented functions: o BROWSE always shows the current position of the display-page in the file, as well as the filename. o Text which is underlined or overstruck is shown in the display by highlighting. o You may search for a string, either forward or backward. Text matching the search-string is highlighted (instead of underlined text). o You may interrupt a search, so that if you accidentally begin a search while examining a very large file, you can regain control of your terminal. o You may alter the format of the display, causing characters which normally are used for carriage control (and are invisible) to become visible. o BROWSE provides you with a "ruler" command which shows you the line number and column of any point in the file. 1.2 COMMAND ENTRY Most commands recognized by BROWSE are single-keystroke. It maps all alphabetic characters to the set of control characters (e.g., "F", "f" and "CTRL/F" are equivalent). INTRODUCTION TO BROWSE Page 1-2 Commands which require more information than a single keystroke prompt you in the status line for the required information. There are two types of command which result in a prompt: 1. Searches. BROWSE accepts any combination of printing characters for a search target. The DELETE key and CTRL/U, CTRL/X have their normal meaning (delete or cancel). 2. Numeric arguments. Certain commands (e.g., left/right scrolling) accept an optional numeric argument. If you type a numeric digit, BROWSE enters numeric-argument mode, echoing this digit as the first character of your input and listing in the prompt the letters which it will accept as a command. If you type a number followed by one of these (alphabetic) characters, BROWSE will then execute the command. For example, if you typed "12R", BROWSE would scroll right by 12 columns. If you type a digit but do not wish to perform a command, type CTRL/X or CTRL/U. 1.3 SEARCHES BROWSE performs searches and displays their result in an unusual manner: o The search string may contain only printable ASCII characters. This restriction is made to eliminate the keypad-dependency of EDT. The search itself is case-independent. o Blanks within the search string are matched by any type of blank in the file itself (e.g., space, TAB, RETURN, LINE-FEED and FORM-FEED). Multiple blanks are treated as a single blank. o Search-matches may not span a display-line. (A display-line is normally synonymous with a record in the file). o All positions on the display screen which match the search string are highlighted. Thus, you may see all matches at a glance, rather than by cursor movement. o Positions which lie to the left or right of the screen cause the corresponding end of the line to be highlighted. BROWSE does not automatically scroll left/right to the search target. o A search remains in effect until canceled (by searching for an empty string). If you scroll about with an active search, BROWSE will continue to highlight locations in the file which match the search string. Thus, rather than simply duplicate conventional searches (such as that provided by EDT), BROWSE provides you with a powerful examination tool. By treating all white-space the same, BROWSE allows you to ignore the exact amount of spacing. The highlighting makes searches simpler by showing you all INTRODUCTION TO BROWSE Page 1-3 occurrences, rather than each one, one at a time. 1.4 SCREEN ORGANIZATION BROWSE reserves the last line of the screen for status display. It uses the remainder of the screen to display your file. Figure 1 shows a typical screen using BROWSE. Overstruck text (e.g., the title "FLIST - Directory Editor") is highlighted. The file name is given in the status line, as is the range of line numbers shown in the screen (i.e., "1:23"). The range of columns "1:69" is obtained from the current screen-width (for this example, 70), and the amount by which the screen is shifted. The length, in columns, of the longest line on the display is given in parentheses, "(77)". Screen dumped: 21-JAN-1985 07:11:44 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ |FLIST - Directory Editor | | | | FLIST (directory editor) permits the user to sort directories, | | files, delete rename or alter the protection code on files, a| | dynamic display. | | | | Format: | | | | FLIST [*.*;*] | | | | | |Options: | | | | /NOALL Suppress filename if no privilege for other data | | /ALL (D) Read directory entries for all filenames, eve| | insufficient privilege. | | /DBACKUP Show backup dates instead of creation dates | | /NODATE Suppress creation-date+time | | /FAST Suppress all fields other than the filename (*3 fast| | /NOFAST Open each file to obtain auxiliary information | | date, size). | | /NOOWNER Suppress display of owner code | | /NOPROTECTION Suppress display of protection mask | |FL.HLP; Lines 1:23 Cols 1:69 (77) | +---------------------------------------------------------------------+ Figure 1 Sample Screen You may direct BROWSE to display the same screen shifted to the right by typing R. Scrolling and shifting are single-keystroke commands in BROWSE. INTRODUCTION TO BROWSE Page 1-4 Screen dumped: 21-JAN-1985 07:12:03 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ | | | | |the user to sort directories, examine | | the protection code on files, all via a | | | | | | | | | | | | | | | | | | | |if no privilege for other data | |ntries for all filenames, even if | |lege. | |instead of creation dates | |date+time | |s other than the filename (*3 faster) | | obtain auxiliary information (e.g., | | | |f owner code | |f protection mask | |FL.HLP; Lines 1:23 Cols 36:104 (77) | +---------------------------------------------------------------------+ Figure 2 Sample Screen, Shifted Right BROWSE permits you to change the display dynamically. The overstruck text is composed by backspace-overstrikes. By toggling the O-command, you may see these backspaces (i.e., "^H" is a CTRL/H, or backspace). INTRODUCTION TO BROWSE Page 1-5 Screen dumped: 21-JAN-1985 07:11:51 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ |D^HDI^HIR^HRE^HED^HD -^H- D^HDi^Hir^Hre^Hec^Hct^Hto^Hor^Hry^Hy E^HEd^| |^M | | FLIST (directory editor) permits the user to sort directories, | | files, delete rename or alter the protection code on files, a| | dynamic display.^M | |^M | | Format:^M | |^M | | FLIST [*.*;*]^M | |^M | |^M | |O^HOp^Hpt^Hti^Hio^Hon^Hns^Hs:^H:^M | |^M | | /NOALL Suppress filename if no privilege for other data^M | | /ALL (D) Read directory entries for all filenames, eve| | insufficient privilege.^M | | /DBACKUP Show backup dates instead of creation dates^M | | /NODATE Suppress creation-date+time^M | | /FAST Suppress all fields other than the filename (*3 fast| | /NOFAST Open each file to obtain auxiliary information | | date, size).^M | | /NOOWNER Suppress display of owner code^M | | /NOPROTECTION Suppress display of protection mask^M | |FL.HLP; Lines 1:23 Cols 1:69 (89) | +---------------------------------------------------------------------+ Figure 3 Sample Screen with Expanded Carriage Control Even more detail is possible. You may direct BROWSE to show the file-address (cumulative character count) of each display line, and the line number (modulo 100) before each line: INTRODUCTION TO BROWSE Page 1-6 Screen dumped: 21-JAN-1985 07:12:36 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ | 0.01:FLIST - Directory Editor | | 70.02: | | 74.03: FLIST (directory editor) permits the user to sort | | 156.04: files, delete rename or alter the protection cod| | 238.05: dynamic display. | | 260.06: | | 264.07: Format: | | 278.08: | | 282.09: FLIST [*.*;*] | | 308.10: | | 312.11: | | 316.12:Options: | | 344.13: | | 348.14: /NOALL Suppress filename if no privilege for o| | 418.15: /ALL (D) Read directory entries for all fil| | 498.16: insufficient privilege. | | 542.17: /DBACKUP Show backup dates instead of creation d| | 606.18: /NODATE Suppress creation-date+time | | 654.19: /FAST Suppress all fields other than the file| | 730.20: /NOFAST Open each file to obtain auxiliary | | 810.21: date, size). | | 844.22: /NOOWNER Suppress display of owner code | | 896.23: /NOPROTECTION Suppress display of protection mask | |FL.HLP; Lines 1:23 Cols 1:56 (77):79 | +---------------------------------------------------------------------+ Figure 4 Sample Screen Showing File-Address Another keystroke transforms the file-address into record lengths: INTRODUCTION TO BROWSE Page 1-7 Screen dumped: 21-JAN-1985 07:12:43 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ | 68.01:FLIST - Directory Editor | | 2.02: | | 79.03: FLIST (directory editor) permits the user to sort | | 79.04: files, delete rename or alter the protection cod| | 20.05: dynamic display. | | 2.06: | | 11.07: Format: | | 2.08: | | 23.09: FLIST [*.*;*] | | 2.10: | | 2.11: | | 26.12:Options: | | 2.13: | | 67.14: /NOALL Suppress filename if no privilege for o| | 77.15: /ALL (D) Read directory entries for all fil| | 42.16: insufficient privilege. | | 62.17: /DBACKUP Show backup dates instead of creation d| | 46.18: /NODATE Suppress creation-date+time | | 74.19: /FAST Suppress all fields other than the file| | 77.20: /NOFAST Open each file to obtain auxiliary | | 31.21: date, size). | | 49.22: /NOOWNER Suppress display of owner code | | 54.23: /NOPROTECTION Suppress display of protection mask | |FL.HLP; Lines 1:23 Cols 1:56 (77):79 | +---------------------------------------------------------------------+ Figure 5 Sample Screen Showing Record-Lengths By selecting "ruler-mode", you may use BROWSE to determine the column and line number of any point in your file. The ruler is highlighted to make it more readable. INTRODUCTION TO BROWSE Page 1-8 Screen dumped: 21-JAN-1985 07:13:27 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ |FLIST - Directory Editor | | | | FLIST (directory editor) permits the user to sort directories, | | files, delete rename or alter the protection code on files, a| | dynamic display. | | | | Format: | | | | FLIST [*.*;*] | | | | | |Options: | | | | /NOALL Suppress filename if no privilege for other data | | /ALL (D) Read directory entries for all filenames, eve| | insufficient privilege. | | /DBACKUP Show backup dates instead of creation dates | | /NODATE Suppress creation-date+time | | /FAST Suppress all fields other than the filename (*3 fast| | /NOFAST Open each file to obtain auxiliary information | | date, size). | | /NOOWNER Suppress display of owner code | | /NOPROTECTION Suppress display of protection mask | |....+...10....+...20....+...30....+...40....+...50....+...60.... 9| +---------------------------------------------------------------------+ Figure 6 Sample Screen Showing Line/Column "Ruler" Though BROWSE is designed primarily to browse text files, you may also examine binary files with it. Figure 7 was obtained by setting the qualifiers "/OVER:2" and "/MARK". This causes all control characters to be shown as ".", and the record-address and line numbers as a display-prefix. Note that unlike Figures 4 and 5, there are now four columns of numbers shown in the prefix area. BROWSE normally displays one file-record on each display line. However, if a LINE-FEED is found embedded within a record, BROWSE begins a new display line. In Figure 7, the first column shows the record file address, and the second the offset of the new display-line within the record. Because the display lines and records are not synonymous, the record number (third column) is shown separately, from the line number (fourth column). INTRODUCTION TO BROWSE Page 1-9 Screen dumped: 21-JAN-1985 07:14:33 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ | 0......01.01:..0.@.L.....0204....................;#Qv........| | .0141....02:......... .#.......$.......C.......D.......G... | | .0189....03:...H.......l.?....}$.......!........... | | .0229....04:VMSRTL_001.....$. | | .0247....05:.....!.......T... | | .0265....06:SCRSHR_001......................................| | 512......02.07:all.date.dbackup.drevised.fast.owner.protection.| | .0273....08:%s%s | | .0278....09:..HLP.FLIST.more...... %s. ...Terminal must be V| | .0345....10:..>..=..[0m.[20l..[?4l.?[%d;%d?.... | | .0381....11:....-.%s: \%.8s\.$.%s | | .0403....12:. 00:00:00.00.no.%d%c.%s: %s.%s: %s | | .0439....13:. .Reading: %3d files.Working.....Command failed| | 1024......03.14:ontinue.?help.?columns.?date.?level.?quota.?size| | 1536......04.15:inspect.more.next.nfind.print..LIS.protect.purge| | 2048......05.16:.%d.locked. . . .%%-%ds.%-6s. .%6.6d.%-6s. .%| | 2560......06.17:licable.Repeated display-field: %s.%c., . (%s).D| | 3072......07.18:u cannot view this file.EDIT.HOME.%s%s.HOME.EDTI| | 3584......08.19:.OQ.Q.OR.R.OS.Op.?p.Oq.?q.Or.?r.Os.?s.Ot.?t.Ou.?| | .0180....20:....;%d.r...You are not the file's owner.(NO Pri| | 4096......09.21:roll .Up/.Down 1/2 screen (arrow).. R,L - sc| | 4608......10.22: or arrow keys.Special:. K - Copy screen to| | .0483....23:. Lines %d:%d Cols %d:%d (% | |FL.EXE; Lines 1:23 Cols 1:56 (512):512 Records 1+ | +---------------------------------------------------------------------+ Figure 7 Sample Screen Showing Binary File The status line is extended to account for the additional information. The ":512" indicates the longest record length. The range of record numbers is shown "1+", because (like the prefix line-numbers), the prefix record-numbers are given modulo 100. Scrolling and ruler mode work properly when record addresses and line numbers are shown. The prefix area is fixed on the screen; the content alone is shifted: INTRODUCTION TO BROWSE Page 1-10 Screen dumped: 21-JAN-1985 07:15:43 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ | 0......01.01:06............"..... | | .0141....02: | | .0189....03: | | .0229....04: | | .0247....05: | | .0265....06:................................................| | 512......02.07:el: %d.%s.Total blocks: %d (%d allocated).%s.%s.| | .0273....08: | | .0278....09: | | .0345....10: | | .0381....11: | | .0403....12: | | .0439....13: | | 1024......03.14:end./backward./home./middle./low./forward./colum| | 1536......04.15:fix is legal only on sort-command.+.-. u| | 2048......05.16:;.%d.File '%s' is not a member of file-list.File| | 2560......06.17:LIS.LOG.LST.MAP.OBJ.TMP.TM0.TM1.TM2.TM3.TM4.TM5.| | 3072......07.18:ust be positive.Argument for QUIT must be '*' or| | 3584......08.19:d..[H.[J...Two control/C's in succession trigger| | .0180....20:it.. ? - display this message-screen. _| | 4096......09.21:umn (in scale-mode, move cursor up too). I,J | | 4608......10.22: - Toggle .OVER mode (3 states if /OVER, else | | .0483....23: | | ....+..130....+..140....+..150....+..160... 1| +---------------------------------------------------------------------+ Figure 8 Sample Screen Showing Shifted Binary File 1.5 CONFIGURATION REQUIREMENTS BROWSE runs on any VT52, VT100 or other ANSI x3.64-compatible terminal. BROWSE is written in VMS-C, and requires approximately 50 kilobytes of memory. It has been tested under VMS versions 3.6, 3.7 and 4.0. You may use it to examine any sequential VMS disk file. CHAPTER 2 BROWSE COMMANDS This chapter describes in detail the BROWSE browsing commands. 2.1 SCROLLING COMMANDS BROWSE permits you to scroll forward or backward in units of a half-screen, or left or right in units of a column. The restriction to half-screen scrolling is made to reduce the overhead required to examine a file. This permits you to examine files which are larger than those which you could edit. Most scrolling operations are performed in a single keystroke. You may provide a repeat-count to modify the basic half-screen operations. 2.1.1 Forward/Backward You may scroll through your file in either direction. BROWSE provides you with several commands for this purpose: U The UP command (also CTRL/U) directs BROWSE to scroll up by one half-screen. You may not scroll up past the beginning of the file. D The DOWN command (also CTRL/D) directs BROWSE to scroll down by one half-screen. You may not scroll past the end of the file. F The FORWARD command (also CTRL/F and space) directs BROWSE to scroll down by a full screen. B The BACKWARD command (also CTRL/B) directs BROWSE to scroll up by a full screen. T The TOP command (also CTRL/T) directs BROWSE to scroll to the top of the file (i.e., the first line). E The END command (also CTRL/E) directs BROWSE to scroll to the end of the file. As you scroll or skip forward through a file, BROWSE constructs a table which BROWSE COMMANDS Page 2-2 permits it to rapidly return to the places where you have been. This is useful for returning to the end of the file. It also permits BROWSE to return to the same point on upward scrolling. Each half-screen display overlaps by one line. The overlap-lines are the tabulated positions in the file. By supplying a number before the scrolling command, you direct BROWSE to repeat that operation (without, of course the extra screen operations). For example, if you type 10D BROWSE will scroll forward by ten half-screens (normally 110 lines). (Repeat counts are not applicable to the TOP and END commands.) Whenever BROWSE skips forward into a part of the file it has not read before, it displays (in the status line) the half-screen number which it is currently reading. Because I/O on a heavily-loaded VMS system may be slow, this tells you how far BROWSE has gotten. Scrolling to parts of the file which you have previously viewed is much more rapid; BROWSE need reread only the text to display on that screen. The arrow keys (UP-ARROW and DOWN-ARROW) are normally assigned to the UP and DOWN half-screen scrolling commands. 2.1.2 Aborting A Scrolling Operation If you direct BROWSE to scroll to the end of a file, it will attempt to do just that. However, you may change your mind; you hadn't realized just how big the file really was. To stop BROWSE, type "X". This will cause BROWSE to cease reading new pages. The last screen read will be displayed. 2.1.3 Left/Right You may direct BROWSE to display the file shifted to the left or the right. Unlike vertical scrolling, you may scroll left or right by single columns. BROWSE provides you with several horizontal-scrolling commands: H The HOME command (also CTRL/H, or backspace) returns the display to the "home" column (the leftmost one). J The JUMP command (also CTRL/J, or LINE-FEED) causes BROWSE to scroll right until the end of the longest line (in the current range of lines) is visible in the display. L The LEFT command (also CTRL/L) causes BROWSE to scroll left by one half-screen. You may not scroll left past the home-column. R The RIGHT command (also CTRL/R) causes BROWSE to scroll right by one half-screen. Right-scrolling is limited, based on the current display mode and the maximum record length of the file. BROWSE COMMANDS Page 2-3 You may modify the operation of the HOME, LEFT and RIGHT commands by providing a number before the command: o A number provided for the HOME command directs BROWSE to scroll left or right, placing that particular column at the leftmost position in the screen. o A number provided for the LEFT or RIGHT command directs BROWSE to scroll left or right by that number of columns. The arrow keys (LEFT-ARROW and RIGHT-ARROW) are normally assigned to the LEFT and RIGHT commands. 2.1.4 Column And Line Display There are many applications in which you need to know the exact location of parts of the file which you are examining. BROWSE provides you with a "ruler" mode. When you select ruler-mode (by typing an underscore, "_") BROWSE changes the status line to a combined scale plus line number. The cursor's column is reflected in the scale; its line number is shown as well. Examples of ruler-mode display are reproduced in Figures 1-6 and 1-8. You may move the cursor in units of single columns or lines using the arrow keys. You may temporarily exit ruler mode, and return. The cursor will return to the point at which you exited ruler mode (unless, of course, you scroll to a new screen). The following commands are provided in ruler mode: UP-ARROW moves the cursor up one line. If the cursor is already at the top-of-screen, BROWSE scrolls up by a half-screen. DOWN-ARROW moves the cursor down one line. If the cursor is already at the bottom of the current screen, BROWSE scrolls down by a half-screen. LEFT-ARROW moves the cursor left one column. If the cursor is in the leftmost display-column, BROWSE scrolls left by a half-screen. RIGHT-ARROW moves the cursor right one column. If the cursor is at the end of the scale, BROWSE scrolls to the right by a half-screen. H (also CTRL/H, or backspace) moves the cursor to the HOME-column. If the cursor is already in the HOME-column, BROWSE moves the cursor up one line. I (also CTRL/I, or TAB) moves the cursor right, to the next tab stop (multiples of 8 columns). J (also CTRL/J, or LINE-FEED) moves the cursor to the end of the current BROWSE COMMANDS Page 2-4 display line. If the cursor is already at the end of the display line, BROWSE moves the cursor down one line. You may modify the effect of the arrow keys, as well as the I-command by prefixing the command with a repeat count. In ruler mode, you may use the other BROWSE commands as well. 2.2 SEARCHING BROWSE provides you with a simple, easy to use search command. It displays the points in the file at which the target is found by highlighting each occurrence. 2.2.1 Initiating A Search To initiate a search, type "/" or "\". A forward slash ("/") initiates a forward search; a backward slash ("\") a backward search. BROWSE will prompt you for a search target. You may provide only printing characters (counting space). To make corrections, use the DELETE key, or CTRL/U or CTRL/X to abort the input. Hit the RETURN or ENTER key to complete the text-entry. Whatever you have entered becomes the current search target. A space in your target matches any number of white-space characters (i.e., space, TAB, FORM-FEED or RETURN) in the display. BROWSE begins searching in the current screen for matches against this target. If no matches are found, BROWSE continues the search in the given direction. If BROWSE reaches the end of the file without finding a match, it sounds an alarm, and retains its original position. If a match is found, BROWSE scrolls to the corresponding screen and highlights all matching positions. Matching positions which happen to lie to the left or right of the current column limits are flagged by highlighting the end of the display line closest to the match. If you provide no input (i.e., by hitting CTRL/U or CTRL/X, or by simply hitting RETURN), this clears the search target. If no search target is active, BROWSE highlights overstruck text. 2.2.2 Continuing A Search You may continue a search in either direction, regardless of the direction in which you initiated it: N The NEXT command (also CTRL/N) directs BROWSE to search forward in the file, for the next matching positions. P The PREVIOUS command (also CTRL/P) directs BROWSE to search backward in the file, for the previous matches. BROWSE COMMANDS Page 2-5 2.2.3 Aborting A Search Searching a file always requires I/O, and can be slow. If you wish to stop a search, type "X". This will cause BROWSE to halt the search, and return to its original position. 2.3 ALTERING THE DISPLAY FORMAT BROWSE is used to examine text files, rather than binary ones. You may direct BROWSE to display your file in alternate forms to see its structure (i.e., the actual characters used to make up overstrikes, and the record numbering). The alternatives are intentionally limited to those which are applicable to text (or printer) files. You may not, for instance, use BROWSE as a screen-oriented hexadecimal dump (it strips parity from all characters). Nor does BROWSE interpret escape sequences (it prevents them from affecting your screen). BROWSE, in fact, is designed to be quite robust. It can display the contents of any sequential file without causing your terminal to lock up. Any control characters which are not in its repertoire are converted to "^"-form (e.g., ESCAPE becomes "^["). You may use BROWSE to examine binary (".EXE" and ".OBJ") files. Note, however, that a LINE-FEED always causes BROWSE to begin a new line. 2.3.1 Overstrikes Normally BROWSE interprets overstruck text (created by either backspacing or embedded RETURN characters) and highlights it. For binary files, this may be inappropriate. Or you may wish to expand the sequence of characters which make up the overstruck text. To do this, use the O-command ("O" only, not CTRL/O). BROWSE will alter its interpretation of backspace and RETURN characters. Backspaces are shown as "^H", and RETURN as "^M". Tab characters also are shown as "^I". To undo this command, type "O" again; it simply toggles the display. If you have invoked BROWSE with the qualifier /OVER:2 then the O-command becomes a three-state toggle. The third state shows all control characters (except LINE-FEED) as a ".". This permits you to examine a binary file looking only for character strings. Figure 1-3 illustrates the second state of the O-command. Figures 1-7 and 1-8 illustrate the third state of the O-command. 2.3.2 Marks And Record Numbers You may also use BROWSE to examine the record structure of a text file. VMS BROWSE COMMANDS Page 2-6 files are organized in records which may be of any length up to 32768 characters. Files may have either variable record lengths, or fixed (i.e., all the same). For most text files, records are synonymous with lines, i.e., the record attributes imply carriage control at the end of each record. However, there are files (such as those produced by RUNOFF) which do not have carriage control. Also, even for files having carriage control attributes, carriage control characters (e.g., LINE-FEED) may be embedded within a record. BROWSE makes sense of all this and shows your file as it really is. When it opens a file for examination, BROWSE allocates a buffer large enough to show the longest display line which could be made. Files with no carriage control attributes are assumed to be like those produced by RUNOFF: each record contains characters as needed to produce the desired carriage control. BROWSE appends records until a LINE-FEED is found, either explicitly, or as part of the record attributes. (You may override this action with the "/NOJOIN" qualifier). A record may correspond to a fraction of a display line, or it may be one or more display lines. You may examine the record structure of the display by using the "^"- and M-commands: o The "^" command sets MARK-mode. BROWSE redisplays the current screen with a prefix before each line (see Figures 1-4, 1-5, 1-7 and 1-8). There are either two or four columns of numbers shown in the prefix: - If two, the first is the record file address (the number of characters from the beginning of the file), and the second is the display line number. - If four, the first is the record file address, the second is the offset into a record, and the third and fourth are the record number and line number. o The M-command (also CTRL/M or RETURN) toggles this prefix mode, showing the record lengths, rather than their offsets. It is a three-state toggle; the third state resumes the original display mode. Normally the M-command becomes inactive again on reaching the original display mode. If you use the qualifier /MARKS however, it is permanently enabled. 2.4 OTHER COMMANDS The remaining BROWSE commands are all one-of-a-kind, but all useful: 2.4.1 Exiting From BROWSE To exit from BROWSE, use the Q (quit) command, or Z (also CTRL/Z). BROWSE COMMANDS Page 2-7 2.4.2 Help-Screen You may obtain online help from BROWSE by typing "?" (or PF2). BROWSE displays the help-screen shown in Figure 1: Screen dumped: 21-JAN-1985 06:39:56 Image top: 0 bottom: 22 +---------------------------------------------------------------------+ |BROWSE - Browsing program | |Commands: | | Q,Z - Quit. | | ? - display this message-screen | | _ - toggle scale/normal mode (alters arrow keys also) | | T,E - scroll to Top/End of file. | | F,B - scroll Forward/Backward by a full-screen. | | U,D - scroll Up/Down 1/2 screen (arrow). | | R,L - scroll Right/Left 1/2 screen (arrow) | | H - scroll left to Home-column (in scale-mode, move cursor up | | I,J - (scale-mode) move cursor to next tab stop or to next end-o| | /,\ - search (if '\', backward) for a string | | N,P - search for Next/Previous occurrence of string. | | W - refresh display Window | | X - aborts search/skip | | - Permit H,L/R scroll by specified number of columns, | | or repeat of U,D,B,F,I or arrow keys | |Special: | | K - Copy screen to SNAPSHOT.CRT | | M - Toggle MARK mode (active if /MARK option) | | O - Toggle OVER mode (3 states if /OVER, else 2) | | V - Display current Version | | ^ - Toggle MARK (DEBUG) modes | |FL.HLP; Lines 1:23 Cols 1:71 (77) | +---------------------------------------------------------------------+ Figure 1 Help Summary 2.4.3 Screen-Refresh If your screen becomes corrupted by line noise, or by unexpected system messages, you may direct BROWSE to refresh the screen. The W command causes BROWSE to re-read the current page and then redisplay it. A CTRL/W may be given at any time (even while entering a search target), and refreshes the screen without re-reading the page. The re-read operation is provided to make BROWSE cleaner: o If you have directed BROWSE to display the help-screen, the W command will redisplay the file, rather than the help-screen. o If you are using the M-command to display record marks, BROWSE may discover in the middle of a page that the file actually has records with embedded carriage control. The prefix jumps, from two columns of BROWSE COMMANDS Page 2-8 numbers, to four. Requiring BROWSE to read each page first to determine this case would make it slower. The W command re-reads the page and makes the prefix columns all the same width. 2.4.4 Screen-Dump You may obtain a copy of the screen contents by using the K command (also CTRL/K). All of the figures in this document were generated using this facility. When you issue a screen-dump command, the screen driver makes a copy of the current screen and writes it to a file: SYS$LOGIN:SNAPSHOT.CRT When you exit from BROWSE, this file is closed and you may print it. Highlighting is represented in the snapshot-file by underlining. The time and date of the snapshot are written to the file as well. Each time you invoke the screen dump, BROWSE informs you of how many times you have done so. The CTRL/K screen dump is recognized at all times by BROWSE. The K command, of course, is not recognized during prompts. 2.4.5 Version Typing a V (also CTRL/V) causes BROWSE to display its version number in the status line. CHAPTER 3 INVOKING BROWSE To run BROWSE, type the DCL command "BROWSE", followed by the name of the file which you wish to browse. No default filetype is used. For example, the command BROWSE XYZ is equivalent to BROWSE XYZ. BROWSE recognizes several options, which you may supply in any order: /BG The BitGraph terminal is VT100-compatible, but in its native mode it displays 65 lines on the screen. The VMS terminal driver coerces the BitGraph to VT100 mode when BROWSE is invoked. To run the BitGraph in native mode, use the /BG option. This restores the terminal to native mode after the terminal driver has set it to VT100 mode. This option may not be used if BROWSE is called from FLIST, since the screen buffer has already been allocated. /MARKS The /MARKS option directs BROWSE to show the file address and number of each record in the input file. The resulting prefix-display (file address and record number) may be toggled on and off with the M-command. The /JOIN and /SQUEEZE options may alter the displayed record number from the true value seen by VMS. The file address, however, is unaffected. /NOJOIN BROWSE examines the record attributes of your file. If it does not have the carriage-control attribute, then BROWSE assumes this is a file with embedded carriage-control characters such as that produced by RUNOFF. For this case, the JOIN option is, by default, active. When JOIN is active, BROWSE joins together records which do not end with a LINE-FEED, so that overstrikes constructed using RETURN may be shown on a single display line. INVOKING BROWSE Page 3-2 To disable this mode (and see the true record structure of a binary file, for instance), use the /NOJOIN command. /OVER If no value is specified, /OVER initially places BROWSE in a display mode where backspace, RETURN and TAB are shown respectively as "^H", "^M" and "^I", rather than used as carriage control. This may be toggled with the O-command. If the value 2 is given (e.g., "/OVER:2"), then BROWSE treats the O-command as a three-state toggle. The third state causes all control characters to be shown as ".". /SQUEEZE Normally BROWSE displays your file exactly as it really is. However, formatted files (such as those produced by RUNOFF) may contain a lot of blank lines. The /SQUEEZE option directs BROWSE to combine into a single "record" sequences of records which contain only whitespace characters (e.g., space, TAB, RETURN). It does not affect the (very rare) cases in which a single record contains a sequence of LINE-FEED characters embedded within non-whitespace characters. /TRIM Depending on the current state of ruler-mode, the J-command causes BROWSE to move the cursor to the next end-of-line, or to simply scroll to put the rightmost end-of-line on the screen. BROWSE normally counts trailing blanks. They are, after all, part of the file. To cause BROWSE to ignore trailing blanks, use the /TRIM option. /WIDE The /WIDE option tells BROWSE to assume that your terminal is really set to 132-column mode, even though you have told VMS (via a "SET TERMINAL") that it is not. This option may not be used if BROWSE is called from FLIST, since the screen buffer has already been allocated. APPENDIX A COMMAND SUMMARY BROWSE BROWSE is a versatile browsing program. It permits left/right up/down scrolling and a variety of display formats. Most commands are single-character. It is case-independent (maps the alphabet to the set of control characters). Format: BROWSE filespec [options] Options: /BG Initialize a Bitgraph terminal to permit BROWSE to present a 65-line display. /COMMAND Read commands from a file (default is BROWSE.CMD, in your login directory), resume interactively on end-of-file. /JOIN The JOIN option directs BROWSE to join (in the display) records which do not end in either line-feed or form-feed. Normally, one or more display lines is used for each record. /MARKS The MARKS option directs BROWSE to show the file-address and record-number of each record. Records containing an embedded line-feed are split across more than one display line. If the file contains records split in this manner, both the line number (modulo 100) and record number are displayed by the MARKS option. /OVER The OVER option directs BROWSE to show non-printing characters and to unwrap overstrikes. If /OVER=2 is specified, all nonprinting characters are shown as ".". /SQUEEZE The SQUEEZE option directs BROWSE to discard blank records when they follow other blank records. This squeezes out most blank lines. /TRIM The TRIM option directs BROWSE to omit trailing blanks in the J-command (jump to next end-of-line). /WIDE If WIDE is set, BROWSE assumes that the terminal is in 132-column mode, even though no SET TERMINAL was done for this. Quit: COMMAND SUMMARY Page A-2 Exit from BROWSE by typing Q. Help: A help-screen is displayed after typing "?" or PF2 (cf: EDT). Scrolling: T scroll to top of file. E scroll to end of file. F scroll forward by a full-screen (space). B scroll backward by a full-screen. U scroll up by a 1/2 screen (up-arrow). D scroll down by a 1/2 screen (down-arrow). L scroll left 1/2 screen (left-arrow). R scroll right 1/2 screen (right-arrow). I in ruler-mode, move cursor to next tab stop J in ruler-mode, move cursor to next end-of-line. Otherwise, scroll left/right to put the end of the longest line on-screen. H scroll left to Home-column (or to absolute column given by argument). {number} Set column for H, number of columns for L or R, or repeat-factor for other scrolling commands. Searching: / search for a string \ search backward for a string N search for next occurrence of string. P search for previous occurrence of string. CTRL/X aborts search/skip. Miscellaneous: K Copy screen to SNAPSHOT.CRT M Toggle MARK mode (active if /MARK option) O Toggle OVER mode (3 states if /OVER, else 2) V Display current version ^ Toggle MARK mode (even if /NOMARK). _ Toggle "ruler-mode". The arrow keys move the cursor directly. The line and column number are continually displayed. W refresh display window Page Index-1 INDEX Arrow keys Highlighting DOWN-ARROW, 2-2 to 2-3 Column-scale (see Ruler-mode), LEFT-ARROW, 2-3 1-7 RIGHT-ARROW, 2-3 Overstruck text, 1-1, 1-3, 2-4 UP-ARROW, 2-2 to 2-3 to 2-5 Screen dump, 2-8 B, backward, 2-1, A-2 Searching, 1-1 to 1-2, 2-4 /BG qualifier, 3-1, A-1 I, tab, 2-3, A-2 /COMMAND qualifier, A-1 Control characters J, jump to end-of-line, 2-2 to Backspace, see CTRL/H 2-3, A-2 LINE-FEED, see CTRL/J /JOIN qualifier, 3-1, A-1 RETURN, see CTRL/M TAB, see CTRL/I K, copy screen, 2-8, A-2 CTRL/B, 2-1 CTRL/D, 2-1 L, left, 2-2, A-2 CTRL/E, 2-1 CTRL/F, 2-1 M, see Toggle-commands CTRL/H, 2-2 to 2-3 /MARKS qualifier, 2-6, 3-1, A-1 CTRL/I, 2-3 CTRL/J, 2-2 to 2-3 N, next, 2-4, A-2 CTRL/K, 2-8 Number CTRL/L, 2-2 Columns, 2-3, A-2 CTRL/M, 2-6 Repeat count, 2-2 to 2-3, A-2 CTRL/N, 2-4 CTRL/P, 2-4 O, see Toggle-commands CTRL/R, 2-2 /OVER qualifier, 3-2, A-1 CTRL/T, 2-1 CTRL/U, 2-1, 2-4 P, previous, 2-4, A-2 CTRL/V, 2-8 PF2, help, 2-7, A-2 CTRL/W, 2-7 CTRL/X, 2-4 Q, quit, 2-6, A-1 CTRL/Z, 2-6 Differences from noncontrol R, right, 2-2, A-2 CTRL/K, 2-8 Ruler-mode, 1-1, 1-7, 2-3 to 2-4 CTRL/W, 2-7 Noncommand "\", search backward, 2-4, A-2 CTRL/O, 2-5 "/", search forward, 2-4, A-2 CTRL/Q, 2-6 /SQUEEZE qualifier, 3-1 to 3-2, CTRL/U, abort input, 2-4 A-1 CTRL/X, abort input, 2-4 T, top, 2-1, A-2 D, down, 2-1, A-2 Toggle-commands M, mark (file-address), 2-6 to E, end, 2-1, A-2 2-7, A-2 O, overstrikes, 1-4, 2-5, A-2 F, forward, 2-1, A-2 "_", Ruler-mode, 2-3, A-2 "^", Set temporary MARK-mode, H, home, 2-2 to 2-3, A-2 2-6, A-2 "?", help, 2-7, A-2 /TRIM qualifier, 3-2, A-1 Page Index-2 U, up, 2-1, A-2 /WIDE qualifier, 3-2, A-1 V, version, 2-8, A-2 X, aborting I/O, 2-2, 2-5, A-2 W, window refresh, 2-7, A-2 Z, end-of-input (quit), 2-6