ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Fixes and Enhancements from 2.0 to 3.3 º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ HEX by Jonathan Durward Enhancements (requested by customers): -Allows dumping to a file for printing -Allows mapping of keys (described below) -File manipulation goodies (change file attributes at a click...) (see F1 in both file selection and editing mode) -Looks at COMSPEC environment variable when shelling -Internal text viewer. Very quick. Fixes: -Problem with Alt-C leaving garbage window behind -F7 button not working properly -Mapping of F2 key making mouse select impossible -Minor Aesthetic stuff Neat Stuff: -Mouse interface -Allows searching: -Multiple HEX values (ie. 'FF 23 7E') -Hex or Text searches -Count occurences of Hex or Text values -Search again -Allows inserting and deleting -Pop-up windows -Configuration: -Colors -Key mapping -Screen saver timeout,memory to use... -Edits files of any size -Change file attributes at a click -Point and click style file selection -Allows viewing with alternate editor -Screen Saver ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Index º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ 1. Command line 2. Overview of files 3. Hex.cfg file 4. Environment variables 5. Mapping keys 6. Additional comments ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º 1. The Command Line º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Usage: HEX [-v] [-t:temp_file] [-l:lines] [filename] \n"); -v View mode (read-only). Speed is greatly increased. -t: Rename temp file. Temp files are usually created by using the current hour,minutes,seconds and hundredth of seconds to prevent multiple temp files from having the same name should someone decide to open more than one session of Hex. -l: Same as HEXLINES variable. If specified here, it will override the ENVIRONMENT variable and config settings. filename This can be a full path, relative path. Using the format *.c for example would list all of the files with a .c extension. One may be picked from there. No Filename This will put you into the file selection mode. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º 2. Quick file Overview º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Hex.exe: Main executable. Should be in path. Hex.cfg: Configuration options. It is first searched for in the path pointed to by HEXPATH. If it is not there, it is searched for in the directory where the hex.exe is found. If it is found in neither, the defaults are used. Hex.hlp: Contains information for help screens. It is searched for in the same way as hex.cfg. Do not touch this file! Any change will seriously screw up the help menus. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º 3. The HEX.CFG File º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ The Hex.cfg file contains settings which are initialized before the program begins. These settings can usually be set using environment variables or from within the program. Entries are of the form KEYWORD=VALUE The following KEYWORDS are currently accepted and are shown with their defaults in this sample Hex.cfg file. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Active Cursor=BLACK,GREEN,BLINK; ³ ³ Inactive Cursor=GREY,GREEN; ³ ³ Marked Text=WHITE,RED; ³ ³ Normal Text=CYAN,BLACK; ³ ³ Offsets=GREEN,BLACK; ³ ³ Titles=GREEN,BLACK; ³ ³ Title values=WHITE,BLACK; ³ ³ ³ ³ AUTO DELETE=NO; ³ ³ BRKOUT=NO; ³ ³ HEXBIG=150000; ³ ³ HEXMEM=50000; ³ ³ LINES=25; ³ ³ OVERWRITE=YES; ³ ³ PAUSE TIME=0; ³ ³ SCRTIME=300; ³ ³ TEMP=c:\temp; ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ The AUTO DELETE variable indicates whether the user wishes to be able to delete files without prompting. If AUTO DELETE=YES then the user can use the Alt-D combination to delete files without prompting. This is useful when one know that they will be deleting many files. The BRKOUT variable indicates what action the control-break key will take when it is hit. If BRKOUT=YES then then the program will break out of the program upon receiving the break signal. This is useful for debugging. The OVERWRITE variable indicates where hex will start in Insert mode or Overwrite mode. The HEXBIG (or BIG FILE) variable controls how big a file must be before it is considered a 'big' file. If a file of this size or bigger is loaded, the user will be asked if they'd like to load the file as read-only. If, for example, someone wanted to peek at part of a 4MEG file, they would normally have to wait quite a while for the temp file to be created. If it was caught by the HEXBIG variable, it would save the user a lot of time! The HEXMEM (or MEMORY or BUFFER) variable sets the maximum amount of memory that is set aside for information storage. The larger the number is, the slower text manipulation will be but disk access will be lessened. You need a minumum of 5000 bytes due to overhead. The LINES variable controls what video mode you are in. Values of 25, 43 or 50 are the recommended ones, but any value can be used. The PAUSE TIME variable controls the number of milli-seconds information windows remain on the screen. A value of one or two thousands might be useful to a new user, where most users will have it set to 0, to make things quicker. The SCRTIME variable holds the number of seconds HEX waits until the screen saver kicks in. The TEMP variable allows you to set the directory in which tempfiles will be written. This directory must be able to hold at least the size of the file you are editing. (RAM drives are great for this!) ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ ³ The following are the colors that may be used ³ ³ ³ ³ "BLACK" ³ ³ "BLUE" ³ ³ "GREEN" ³ ³ "CYAN" ³ ³ "RED" ³ ³ "MAGENTA" ³ ³ "BROWN" ³ ³ "WHITE" ³ ³ "GREY" ³ ³ "BRIGHT BLUE" ³ ³ "BRIGHT GREEN" ³ ³ "BRIGHT CYAN" ³ ³ "BRIGHT RED" ³ ³ "BRIGHT MAGENTA" ³ ³ "YELLOW" ³ ³ "BRIGHT WHITE" ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º 4. Environment Variables º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ BRKOUT ie. set BRKOUT=YES HEXLINES ie. set HEXLINES=25 HEXBIG ie. set HEXBIG=100000 HEXMEM ie. set HEXMEM=50000 HEXPATH ie. set HEXPATH=c:\hex This points to the directory in which the hex.cfg is found. If it is not set the file will be looked for in the directory from which hex.exe was run.If it is not found there, the default values are used. This is also the directory used to find the hex.hlp file. TEMP ie. set TEMP=c:\tmp If this is not set, the current directory will be used. This may be a problem if you are sitting in a directory where you do not have write permissions. Make sure there is enough room in this directory for a swap file the size of the file you are editing (unless in read-only mode). ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º 5. Mapping Keys º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Now, you may map keys! It is fairly basic, but should get the job done. For example, to save a file, the default is Alt-W. If you use an editor that uses ALT-S to save then you would enter the line "MAP=SAVE,31" somewhere in the hex.cfg file. (The mappings will not affect the file selector routine. ie when hex is typed without parameters) Remember that each action can only have one key. So, when mapping, try to map to a key which does not already have a function. If it does, then you will want to re-map that one as well. The format of Mapping is "MAP=," The following are the defaults: MAP=HELP,59 F1 MAP=MARK,60 F2 MAP=INFO,61 F3 MAP=ABORTSELECT,62 F4 MAP=SEARCH,63 F5 MAP=COLORS,64 F6 MAP=LOCKTOTAL,65 F7 MAP=NUMBEROFLINES,66 F8 MAP=PRINTTOFILE,67 F9 MAP=SAVESELECTION,68 F10 MAP=SAVETOCLIPBOARD,43 + (This is only non-ALT,F key allowed) MAP=ALTEDITOR,30 ALTA MAP=COUNTOCC,46 ALTC MAP=EDITNEWFILE,18 ALTE MAP=GOTOOFFSET,34 ALTG MAP=INSERTMODE,23 ALTI MAP=GOTOPAGE,25 ALTP MAP=SAVE,17 ALTW MAP=EXIT_,45 ALTX MAP=SHELL,44 ALTZ MAP=SEARCHAGAIN,89 F6 MAP=INSERT,82 NOTE!!! Alt-X will always escape. (But you may map another key to it such that it will as well) Ascii_Codes Function Keys: F1-F10 59-68 ie. F5 is 63 Shift Function Keys: #F1-#F10 84-93 ie. Shift F5 is 88 Alt: QWERTYUIO 16-25 ASDFGHJKL 30-38 ZXCVBNM 44-50 ^--------------- | ie. Alt-V is 47--| ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º 6. Additional Comments º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ GETTING HELP It is recommended that you use the F1 option to get help in both the file selection mode and file editor mode. Go through all of the options available, learning the significance of all of the different functions. HORSES MOUTH If you have any other questions or requests for enhancements, please do not hesitate to mail me at jgdurwar@uwaterloo.ca.