home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / editors / v-210.arj / VIEW.DOC next >
Text File  |  1992-05-01  |  22KB  |  434 lines

  1.                        ┌────────────────────────────┐
  2.                        │          VIEW.EXE          │
  3.                        ╞════════════════════════════╡
  4.                        │  Programmed by Jim Wilson  │
  5.                        │Copyright(C) 90-92 * Ver 2.1│
  6.                        └────────────────────────────┘
  7.  
  8.  
  9.  
  10.     Stop,   hold  the  presses!  Major  story  breaking  -  View  has  been
  11.     rewritten!  Yep,  it's  true.  This little file viewer has had almost a
  12.     complete   rewrite,   all   for   the   sake  of  speed  and  increased
  13.     functionality.  I've  added  lots  of  features and enhanced it's value
  14.     tremendously  (at  least I think so). For example; there is no longer a
  15.     64K  file  size  limit  -  you can load files that are equal in size to
  16.     your  available  RAM  (minus  what View itself needs, of course). There
  17.     is  no  longer  an  80  character  per  line restriction - you can read
  18.     lines  up  to  250  characters  wide.  Loading  files from disk is also
  19.     about  200%  faster!  For  those  of you still using versions 1.0, 1.1,
  20.     and  1.11  you  might  not  notice  the changes immediately because the
  21.     program appears the same - but you will, trust me.
  22.  
  23.  
  24.     If  all  this  sounds  kind  of dramatic for such a little program then
  25.     maybe  I  let  my  enthusiasm get the best of me. You see, I've spent a
  26.     great  deal  of  time  enhancing View, so read on and find out what I'm
  27.     talking about.
  28.  
  29.  
  30.  
  31.     ┌──────────────────────┐
  32.     │ GENERAL INFORMATION  │
  33.     └──────────────────────┘
  34.  
  35.     View  is  a  text  and ASCII file viewer. You can use View to read just
  36.     about  any  BAT,  DOC,  TXT,  or Read.Me type of file. It allows you to
  37.     read  a  file  with  up  to  15,000  lines, or as many as will fit into
  38.     your  RAM.  Each  line  can  contain  up  to  250 characters. What's so
  39.     special about that? I'm glad you asked!
  40.  
  41.  
  42.     There  are  a  million text file viewers floating around. Hell, you may
  43.     have  even  written one yourself. I've written three or four different,
  44.     but  somewhat  specialized,  viewers  over the years. If you have spent
  45.     more  than  2  seconds with any ShareWare or Public Domain software you
  46.     know  that  the  manual is usually a DOC file included on the diskette,
  47.     just  like  this  one.  There is almost always a Read.Me file with last
  48.     minute  changes  that  didn't  make the manual on time (most commercial
  49.     software  even  contains one). Some of these files can grow quite large
  50.     (I  saw  a  ShareWare  programmer's editor that had a DOC file that was
  51.     357K -  too big to be loaded by the editor it came with!).
  52.  
  53.  
  54.     Your  only  available  choices for reading files of this type have been
  55.     either  a  file  viewer that could only read one 64K block of text at a
  56.     time  (one  memory  segment,  which  View use to be), one that tried to
  57.     read  the  entire  file  into RAM (which meant you usually had a viewer
  58.     with  a  big  EXE file or one that took a lot of RAM itself), your word
  59.     processor  (what  a lousy choice that is), or your text editor. If your
  60.     file  was  real  big  most viewers or word processors would not be able
  61.     to  load  the  entire  thing  so  they wouldn't load ANY of it. If your
  62.     lucky  the  text editor you use is able to "unload" the text that can't
  63.     fit in memory onto your hard drive like the one I use - Bingo.
  64.  
  65.  
  66.     Now,  just  because  you  have about 550K of available RAM doesn't mean
  67.     that  your  viewer  or  editor  could  load  a file that big - it needs
  68.     space  to  work  in  too.  Enter View. With View you can read any ASCII
  69.     text  file,  even ones that are over 450K! And if the file is too large
  70.     for  RAM  View  doesn't just say "sorry pal, it's too big for me so I'm
  71.     going  to  exit  to DOS" (which a lot of programs do!), it will display
  72.     what it could read.
  73.  
  74.  
  75.     In  short,  Views  combination  of speed, features, and small size make
  76.     it  the  ideal  choice for almost anybody. Because the EXE file is only
  77.     9,461 bytes  you  can  carry  it  anywhere.  And  since  all  the major
  78.     movement  commands  are  present (Arrows, PgUp, PgDn, Home, End, etc..)
  79.     you're   not  sacrificing  features  for  portability  or  speed.  This
  80.     program  has  been  carefully crafted to use as little of your precious
  81.     RAM as possible, so there's more available for your file.
  82.  
  83.  
  84.  
  85.     ┌──────────────────────┐
  86.     │ PROGRAM INFORMATION  │
  87.     └──────────────────────┘
  88.  
  89.     View  uses  ONLY  about  82K of RAM for itself. This means that you can
  90.     use  it  on  virtually  any  PC.  (If  you  don't  have  that  much RAM
  91.     available  your  in the wrong business!) Essentially what this means is
  92.     that  all  the  remaining conventional (base) memory in your system can
  93.     be  used  for  file  storage.  For example; if, after having loaded all
  94.     your  device  drivers  and TSR's you have 560K of RAM free (as reported
  95.     by  chkdsk  or  some  similar  program), then you would be able to load
  96.     and  read  any  ASCII  text file up to almost 480K! Not too bad from an
  97.     EXE file of only 9,461 bytes!
  98.  
  99.  
  100.     View  starts  by verifying that the file you want to read exists. If it
  101.     does  View  then  verifies  that  the file actually contains data (some
  102.     viewers  will  attempt to read a file with 0 bytes of data!). View then
  103.     checks  to  see  that  you have at least 85K of free RAM. If everything
  104.     is  good  up  to  this  point  View then loads itself into memory. Once
  105.     loaded,  it  proceeds  to  set  up  15,000 5 byte pointers for the data
  106.     structure  (each  one  will contain a line number and the string length
  107.     for  the  data  it  is about to read). After the pointers have been set
  108.     up  View  then  starts  reading  until  it reaches the end of the file,
  109.     runs  out  of  RAM,  or until it has read 15,000 lines (the 15,000 line
  110.     limit will be explained later).
  111.  
  112.  
  113.     Once  the  file  has been loaded you can use the up, down, left, right,
  114.     ctrl-left  and  ctrl-right arrows, along with the PgUp, PgDn, Home, and
  115.     End  keys  to  move  around.  If  you  hit  a wrong key or if you hit a
  116.     "limit"  (like  hitting  PgDn  when  your on the last page already) the
  117.     program gives a very gentle beep (not the annoying kind!).
  118.  
  119.  
  120.     I've   spent  a  considerable  amount  of  time  fine  tuning  the  RAM
  121.     requirements  for  View. The program itself would only require about 7K
  122.     to  run  if  I didn't have to use 15,000 pointers. However, without the
  123.     pointers   the   program  wouldn't  serve  an  purpose!  With  all  the
  124.     "tweaking"  that  was  done  I probably gave View the ability to read a
  125.     file  that  was 25K - 30K bigger then when I first wrote the new memory
  126.     scheme.   That   may   not   seem   like  a  lot  in  todays  world  of
  127.     multi-megabyte  systems,  but  when  you  only have 640K of RAM for DOS
  128.     all  of  the  sudden 30K seems like a lot. Even with that I was able to
  129.     give  the  program  a  few  extra  features  like  a status line at the
  130.     bottom  of  the  screen  which  contains  the  name  of the file you're
  131.     viewing,  the  current  line  number, the last line number in the file,
  132.     and  the  right  column  position.  I've also incorporated direct video
  133.     writes  (which  required  a procedure to determine what type of monitor
  134.     you  have),  pretty  good  error  checking, a goto line number feature,
  135.     and  even  a  brightness  control  for  laptops  or  PC's  with  crappy
  136.     contrast  (does  your  present file viewer have a brightness control as
  137.     a feature?).
  138.  
  139.  
  140.  
  141.     ┌────────────┐
  142.     │ RAM USAGE  │
  143.     └────────────┘
  144.  
  145.     OK,  enough  of  the  propaganda,  now  let's get serious. The RAM that
  146.     View uses is broken down as follows:
  147.  
  148.            75K - 15,000 5 byte data pointers.
  149.             3K - Error checking and all status information
  150.             4K - Video writes, keyboard routines, associated "housekeeping"
  151.          =====
  152.            82K - Total RAM used by View.Exe (approximately)
  153.  
  154.     Not  too  bad,  huh?  The  EXE  file  is only 9,461 bytes, which is 539
  155.     bytes  less  then  my  maximum  target of 10,000. It will work with ANY
  156.     type  of  monitor, be it monochrome, CGA, EGA, VGA, LCD, Gas Plasma, or
  157.     whatever  you  happen  to  have.  (As  a  matter of fact, the procedure
  158.     which  attempts  to  determine  what  type  of  monitor  you have is so
  159.     accurate  that  you will probably never have to use the /M command line
  160.     option,  which  is  discussed  a  little  later  in this document). The
  161.     video  writes  and  the  keyboard handler were written in assembler for
  162.     the fastest possible performance on any computer.
  163.  
  164.  
  165.  
  166.     ┌────────────────┐
  167.     │ KEYBOARD USAGE │
  168.     └────────────────┘
  169.  
  170.     The  keys  that View uses are all pretty self-explanatory (hell, if you
  171.     made  it  this far in the documentation you figured out how to use most
  172.     of them already). Here's a listing of them, anyway.
  173.  
  174.     LeftArrow  - Moves the data on the screen 5 columns to the left
  175.     RightArrow - Moves the data on the screen 5 columns to the right
  176.     UpArrow    - Moves back to the previous line of data
  177.     DownArrow  - Moves down to the next line of data
  178.     PgUp       - Moves back to the previous 24 lines of data (1 page)
  179.     PgDn       - Moves down to the next 24 lines of data (1 page)
  180.     Home       - Goes to the first line of the file
  181.     End        - Goes to the last line of the file
  182.     CtrlLeft   - Moves the data 40 columns to the left
  183.     CtrlRight  - Moves the data 40 columns to the right
  184.     B or b     - Toggle: turns the brightness of the data up or down
  185.     G or g     - Goto a specific line number
  186.     ESC        - Exits View
  187.  
  188.  
  189.     NOTE:  When  using  the  'G'oto  function the line number you specified
  190.     will  be  placed directly above the status line. If you select a number
  191.     less  then  24  then  View will display the first page of data from the
  192.     file.  If  you specify an invalid line number then View will just beep.
  193.     If  you  decide  that the number you entered is not correct you can hit
  194.     the  BACKSPACE  key  to  erase  it.  If  you  decide against using this
  195.     function at all you can hit the ESC key to cancel.
  196.  
  197.  
  198.     Another  bit  of  information that might make you understand the status
  199.     line  a  little  better;  the Col:## is the right most column currently
  200.     being  viewed  while  the  Line:##  is  the  last line displayed on the
  201.     screen.  This  makes the numbers you see always the extremes - the last
  202.     line and the last column of that particular screen.
  203.  
  204.  
  205.  
  206.     ┌─────────────────┐
  207.     │ PROGRAM OPTIONS │
  208.     └─────────────────┘
  209.  
  210.     View supports only three command line options, which are:
  211.  
  212.              /? or /H - A small help screen
  213.                    /M - Forced monochrome mode
  214.          Filename.Ext - Name of the file to view
  215.  
  216.     Options  can  be  entered  in any order and you can use either upper or
  217.     lower  case  letters,  but  you  must leave a space between each option
  218.     selected.  All  unrecognized commands are ignored. One option causes an
  219.     immediate  response  -  /?  (or  /H).  This instructs View to print the
  220.     help  screen  and  then  return  to DOS. This option will be acted upon
  221.     REGARDLESS  of  where  it's  placed  on  the command line. If you don't
  222.     specify  a  file  name  you will get the help screen to remind you what
  223.     to do. The definition of the available options is:
  224.  
  225.     /? or /H - Use  this  option to get a help screen that looks similar to
  226.                the  one above. If no file name is given on the command line
  227.                then View will print this Help screen as a reminder.
  228.  
  229.           /M - By default View displays white text on a blue background. On
  230.                most  systems  this  doesn't  present a problem. However, on
  231.                certain   laptops,  portables,  and  monochrome  EGA  or VGA
  232.                monitors  this  can be difficult to read. Use this option to
  233.                instruct  View  to  display  white  characters  on  a  black
  234.                background.  The  'B'rightness  command  will recognize your
  235.                selected color choice and will work accordingly.
  236.  
  237.     Filename - The  name  of the file you would like to view. Drive letters
  238.                and paths are fully supported.
  239.  
  240.  
  241.  
  242.     ┌─────────────────┐
  243.     │ VERSION HISTORY │
  244.     └─────────────────┘
  245.  
  246.     1.0 - Initial  release  to  the  general  public.  Only  used by myself
  247.    6/91   prior to that.
  248.  
  249.  
  250.     1.1 - Added  the  /I  option to ignore blank lines. Added the /S option
  251.    8/91   to  check  the  file  size  in  lines. Fixed a bug with the error
  252.           checking  routine. Fixed a bug when you had a file with less than
  253.           24  lines  (1  full  page)  of text. Fixed a bug with the monitor
  254.           checking procedure.
  255.  
  256.  
  257.     1.11- Fixed  a  bug  with  file  names that started with a number, like
  258.    10/91  4DOS.DOC.  View  mistook  that  for  a  'start  at  line  number'
  259.           command (similar to the /##### option).
  260.  
  261.  
  262.     2.0 - Major  rewrite!  Removed  the  /#####  (start at line number), /I
  263.    3/92   (ignore  blank  lines),  and  the  /S (show size of file) options
  264.           because  they  are  no longer necessary (they existed strictly to
  265.           make  the  64K  file  size  limit  a little more bearable). Added
  266.           support  for  the left and right arrow keys, the 'B'rightness and
  267.           the  'G'oto  line  number functions as well as being able to load
  268.           files  up  to the maximum size of your free RAM. All this and the
  269.           EXE file is only 1.1K larger!
  270.  
  271.  
  272.     2.1 - Added  the  ctrl_left  and  ctrl_right  arrow  keys to scroll the
  273.    5/92   screen  40  columns  to  the  left/right,  respectively.  Fixed a
  274.           memory  allocation  error where View was loading 1 line less then
  275.           it  said  it  was if your file was either 15,000 lines long or it
  276.           used  up  all  the RAM in your system before the end of the file.
  277.           Added  some  color  to  the  display,  for those of us with color
  278.           monitors.  Fixed  a  bug  with  the  'G'oto  command  if the user
  279.           entered  a  number  larger  then the total number of lines in the
  280.           file.  Performed  some  general "housekeeping" on the source code
  281.           for  the  sake of speed and/or size. All this and the EXE file is
  282.           now  148  bytes  smaller than version 2.0! Yeah I know, 148 bytes
  283.           ain't  much - but how  many times have you seen a program updated
  284.           with  new  features  and  bug  fixes that actually got smaller in
  285.           size?
  286.  
  287.  
  288.  
  289.     ┌──────────────────┐
  290.     │ FINAL RAMBLINGS  │
  291.     └──────────────────┘
  292.  
  293.     Some last words of wisdom (or at least as close as I can come).
  294.  
  295.  
  296.     As  with  all Public Domain programs I take no responsibility for View.
  297.     If  it  blows  up  in  your  face then it's your fault, not mine. It if
  298.     melts  your  hard drive, then so be it. If it makes you wish you were a
  299.     Vulcan  (for  all  you  Star  Trek  fans) then "live long and prosper".
  300.     Actually,   I  get  pretty  fed  up  with  the  legal  crappola  that's
  301.     necessary  in  todays world. Of course my program won't blow up in your
  302.     face  or  melt your hard drive - I'm being sarcastic and ridiculing the
  303.     legal  establishment!  I  use  View  every  day and I have yet to see a
  304.     Vulcan (prior to consuming larger quantities of Becks, that is).
  305.  
  306.  
  307.     View  has  a  "big"  brother  called ReadIt. Yes, that's right - if you
  308.     like  View  but  want  something  a little more powerful I can help you
  309.     out.  You  see,  View  is  kinda like my "test bed" for new ideas. It's
  310.     also  something  I happen to give away for free because I'm a nice guy!
  311.     ReadIt  is  my  ShareWare  version,  the  one you have to pay for. Both
  312.     View  and  ReadIt  share  the  same  basic "engine" (file access, error
  313.     handling,   keyboard  reading,  and  video  writes).  ReadIt,  however,
  314.     includes  online  help,  text search (context sensitive or not), a file
  315.     information  window,  monochrome or color selection, and the ability to
  316.     print  any  part  of  the  file. This is all wrapped up in an interface
  317.     featuring  popup  windows  with  shadows  and  an EXE file size of only
  318.     about  16K!  If  this  sounds good to you then send just $10.00 dollars
  319.     to  the  address  at  the  end  of  this  DOC file, along with a letter
  320.     containing  your  name  and address, and I'll rush a copy of ReadIt out
  321.     to you.
  322.  
  323.  
  324.     If  you  happen to be one of the few unfortunate souls who still have a
  325.     CGA  monitor  you had better be prepared for a "blizzard" of snow. View
  326.     writes  directly  to  video  RAM  and  I didn't program any routines to
  327.     perform  the  necessary  synchronization  for the video retrace signal.
  328.     On all other types of monitors there will be no problems.
  329.  
  330.  
  331.     View  works  exclusively  in  read  only  mode.  What exactly does that
  332.     mean?  Well,  it  means  you  can  read  ANY  file,  regardless  of its
  333.     attributes  (hidden,  system,  readonly)  or  its  type (DOC, TXT, HLP,
  334.     etc).  View  doesn't  create  any  temporary files for data storage nor
  335.     does it alter the original so you can use it without concern.
  336.  
  337.  
  338.     The  15,000  line  limit  you keep seeing mentioned in this document is
  339.     not  because  of me - it's because of Borland. For some reason they set
  340.     a  limit  on  the  size  of  a  data structure you can create when your
  341.     allocating  RAM  from  the  heap.  I don't know if Turbo C suffers from
  342.     the  same  restriction  as  Turbo Pascal, which View was written in. If
  343.     it  were  up to me I would only have a limit on the amount of RAM used,
  344.     not the size of the data structure.
  345.  
  346.  
  347.     From  time  to  time  you  might see some strange symbols appear on the
  348.     screen.  This  is  the  way  View  prints  the  TAB  (ASCII  code 009),
  349.     FORMFEED  (ASCII  code  012),  and  a few other "difficult" characters.
  350.     Since  there  is  no  standard  TAB  size  I  didn't write a routine to
  351.     "expand"  TAB's  into  spaces.  Very  few  files  are  saved with TAB's
  352.     anyway,  so  this  shouldn't  be a problem.
  353.  
  354.  
  355.     The  three  areas  I've concentrated on the most when writing View were
  356.     file   reading,  video  writes,  and  memory  allocation.  These  three
  357.     functions  were  tweaked  and tweaked till they screamed. Consequently,
  358.     they  are  the areas that work the fastest and consume the least amount
  359.     of memory (as it should be).
  360.  
  361.  
  362.  
  363.     ┌──────────────┐
  364.     │ WHAT'S NEXT? │
  365.     └──────────────┘
  366.  
  367.     What's  next  for View? Well, I'm not really sure. My main objective is
  368.     to  keep  the  program  small  and  fast  - that design goal will never
  369.     change.  However,  I'm  not  going  to  ignore a good suggestion for an
  370.     enhancement  if  you've  got  one.  Want a neat new feature added? Then
  371.     drop  me  a  line  at the address below and I'll check into it. Some of
  372.     the  things  I'm  contemplating  are:  a  search  or  find  function, a
  373.     "bookmark"  or  place holder to mark a spot in a file so you can easily
  374.     jump  back  to  it  later,  the  ability  to use EMS or XMS memory, and
  375.     maybe  the  ability  to expand TABS into spaces (for the few files that
  376.     actually saved with TABS and not spaces).
  377.  
  378.  
  379.  
  380.     ┌──────────────┐
  381.     │ REGISTRATION │
  382.     └──────────────┘
  383.  
  384.     Why  is  this  part of View.Doc last? Because it's the least important,
  385.     that's why! I don't believe in a lot of legal rhetoric.
  386.  
  387.  
  388.     VIEW  IS  A  PUBLIC DOMAIN PROGRAM. YOU ARE FREE TO USE IT FOR YOUR OWN
  389.     *PERSONAL*  USE.  YOU  ARE  ENCOURAGED  TO  GIVE  IT AWAY TO ANYONE AND
  390.     EVERYONE WHO WANTS IT (except as noted below).
  391.  
  392.     The only real restrictions I impose are:
  393.  
  394.     1. Whomever  you  give  this  program  to,  whether  you copy it onto a
  395.        diskette,  a  hard drive, or you upload it to a BBS, *MUST* be given
  396.        the  complete  set  of  files (at this writing they are View.Exe and
  397.        View.Doc).
  398.  
  399.     2. None  of  the  files  (View.Exe  or  View.Doc) may be altered in any
  400.        fashion and must remain in their ORIGINAL form. NO EXCEPTIONS!
  401.  
  402.     3. You  CANNOT,   under  ANY  circumstance,   use  this  program  in  a
  403.        commercial,  retail,  promotional,  or other similar fashion without
  404.        the expressed written consent of the author.
  405.  
  406.     4. You  CANNOT,  under  ANY  circumstance,  use  this program to make a
  407.        profit.  This  includes  distributing  it  with  your  own software,
  408.        selling  it,  "renting"  it,  or any other such arrangement that you
  409.        obtain reimbursement for.
  410.  
  411.     If  you  do desire to distribute View with your ShareWare catalog, your
  412.     commercial  software,  or  for  any other non-personal endeavor, please
  413.     write  to  me  at  the  address  below.  I  would be more then happy to
  414.     license  View  to  just about anybody. Remember, it's entirely free for
  415.     personal use!
  416.  
  417.  
  418.     If  you  would  like  to  be  kept  abreast  of  any  new  developments
  419.     concerning  View  then  send  me a buck (one thin dollar!) and I'll add
  420.     your  name  to  the  mailing  list.  Make sure you tell me what version
  421.     your  using.  If  you  would like me to automatically send you the next
  422.     version  then  send  me  five bucks. Even if you don't send a buck (you
  423.     cheap  skate)  feel  free  to  drop  me a note and let me know what you
  424.     think about View, especially if you've found a bug (God forbid!).
  425.  
  426.  
  427.  
  428.                           ╓────────────────────────╖
  429.                           ║       Jim Wilson       ║
  430.                           ║      9 Miller Ave      ║
  431.                           ║  Washington, NJ 07882  ║
  432.                           ╙────────────────────────╜
  433. 
  434.