home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / kpwdemo.zip / ENGINEDE.HYP < prev    next >
Text File  |  1990-06-28  |  4KB  |  99 lines

  1. //Using ENGINE.KB
  2.  
  3.   Using ENGINE.KB
  4.  
  5.   #mDescription of ENGINE.KB#m
  6.   #mThe format of hypertext files#m
  7.   #mHow ENGINE.KB works#m
  8.   #mCustomizing ENGINE.KB#m
  9.  
  10. //Description of ENGINE.KB
  11.  
  12.   This program, ENGINE.KB, is a simple knowledge base that
  13.   creates a hypertext file reader.  It allows you to create
  14.   text files which contain paragraphs of text linked together
  15.   by hypertext.  The file you are now reading, ENGINE.HYP,
  16.   is a sample of a hypertext file.
  17.  
  18.   When the user selects a file to read, the first subject in 
  19.   the file is initially displayed.  This is usually an index
  20.   or a table of contents which lets the user access the other
  21.   subjects in the file.  Each indexed item is actually a 
  22.   hypertext phrase.  In this program hypertext appears blue
  23.   on color monitors and underlined on mono monitors.  To select
  24.   hypertext just point and click the mouse or press TAB
  25.   or SHIFT TAB to move the cursor and ENTER to select the
  26.   hypertext.
  27.  
  28.   At each screen the user can select hypertext, go back to the
  29.   previous screen, return to the top level, print the screen
  30.   or, exit the program.
  31.  
  32.   Next subject:  #mThe Format of hypertext files#m
  33.  
  34. //The Format of hypertext files
  35.  
  36.   Each subject in the hypertext file is identified by a subject 
  37.   title preceeded by a double slash. The title is written
  38.   onto the title bar of the window but is not displayed on
  39.   the main screen.  All spaces and line feeds remain as typed
  40.   into  the file.  Any words surrounded by the characters ##m
  41.   are identified as hypertext. 
  42.  
  43.   Look at the file ENGINE.HYP to see an example of a file
  44.   correctly formatted to be used with ENGINE.KB.
  45.   
  46.   Next subject: #mHow ENGINE.KB works#m
  47.  
  48. //How ENGINE.KB works
  49.  
  50.   The source code of ENGINE.KB is commented to explain how
  51.   it is used to read hypertext files.  The use of the topic
  52.   MARK is basic to the design of the program.  When a 
  53.   a hypertext phrase is selected, it can be explicitly linked
  54.   to a topic with the same name as the phrase or, if it 
  55.   doesn't find a topic with the same name it will call the
  56.   special topic MARK, passing the text of the phrase as a
  57.   parameter.  In MARK we read the hypertext file starting
  58.   at the location where we find the hypertext phrase preceeded
  59.   by double slashes until the next set of double slashes is
  60.   encountered.  We keep track of which subjects have been 
  61.   read in the topic LIST.  This lets us back up over the 
  62.   subjects we've already viewed.
  63.  
  64.   This hypertext engine has been purposely kept simple so you 
  65.   can understand how it works.  In a commercial hypertext
  66.   engine, all the features are locked in so it must be made
  67.   very complex to try to suit the needs of many different types
  68.   of applications.  One of the advantages to having control 
  69.   over the engine is that you can use the basic framework 
  70.   of the engine but customize it to suit your particular needs.
  71.  
  72.   Next subject: #mCustomizing ENGINE.KB#m
  73.  
  74. //Customizing ENGINE.KB
  75.  
  76.   The help knowledge base KPHELP.KB included with your system
  77.   is actually just a slightly customized version of ENGINE.KB.
  78.   The main change to the knowledge base is that instead of
  79.   directly reading the hypertext file we read an index of the
  80.   file created using INDEX.KB.  Since the hypertext file was
  81.   over 300K, this makes accessing the file much quicker.
  82.   INDEX reads the hypertext file, extracting all phrases 
  83.   preceeded by a double slash and records the location of the
  84.   phrase and the number of characters to the next double
  85.   slash.  In the topic MARK we read the index to find the 
  86.   information for the current phrase and then set the file 
  87.   pointer directly to the correct location and read in the 
  88.   number of characters specified. 
  89.  
  90.   Another change made in KPHELP is the addition of a feature
  91.   that lets you copy part of the information from the 
  92.   hypertext file directly into the clipboard.  If you look
  93.   at the code for KPHELP.KB and the KPHELP.DAT file you can
  94.   see how this has been implemented. It shows how a very
  95.   simple change can add an important and powerful feature.
  96.  
  97.   
  98.  
  99.