home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / FLEXLIST.ZIP / DEMO.HTX < prev    next >
Text File  |  1989-07-28  |  7KB  |  169 lines

  1.         demo.htx
  2.         Copyright  1989, John W. Small, All rights reserved
  3.         PSW / Power SoftWare, P.O. Box 10072
  4.         McLean, Virginia 22102 8072
  5.         (703) 759-3838
  6.         7/27/89
  7.  
  8. demo
  9.         Copyright  1989, John W. Small, All rights reserved
  10.  
  11.  
  12.         Press F1, Help, to learn how to use this hypertext Program.
  13.  
  14.         This hypertext program hypertxt was written using FlexList.  It
  15.         utilizes lists of lists nested three levels deep and yet
  16.         was written without coding any linked lists.  In fact the
  17.         program was completed after three major redesigns all in
  18.         less than 1 1/2 man weeks.  This was possible because with
  19.         FlexList no linked list primitives had to be written or
  20.         rewritten in order to accommodate the redesigned data
  21.         structures.
  22.  
  23.         See also:
  24.  
  25.             FlexList Hypertext Manual manual|flexlist.htx
  26.  
  27.             other examples examples|examples.htx
  28.  
  29. hypertxt
  30.  
  31.  
  32.         As you browse down a hyperlink hlinks|hypertxt.htx path the hypertext program
  33.         builds a stack of previous topics topics|hypertxt.htx tranversed.  Each topic on
  34.         this pending topic stack topic stack is a list of hyperlinks appearing
  35.         in that pending topic.  When you return to a previous topic
  36.         using <Backspace> keys|hypertxt.htx the topic is popped and redisplayed.
  37.  
  38.         A hyperlinks list hlinks list is built only when its associated topic
  39.         is first displayed.  Each hyperlink node in this list stores
  40.         the hyperlink's visible text, its invisible topic path, and
  41.         the hyperlink's screen position.  Thus this list allows the
  42.         cursor to be repositioned on the screen without rereading the
  43.         hypertext file to do so.  Remember, text from the hypertext
  44.         file is never stored in RAM.
  45.  
  46.         A hypertext file is represented in RAM by a list of its topics.
  47.         A node in this list contains the name of the topic and its
  48.         position in the hypertext file.  Actually each page pages|hypertxt.htx of a topic
  49.         has its own node in this list referred to as a hyperpages list hpages list.
  50.         Each hyperlinks list references a node in a hyperpages list.  A
  51.         hyperpages list can be reference by more than one hyperlinks list.
  52.  
  53.         Here is the overall hypertext program's lists of lists structure:
  54.  
  55.  
  56.         topics topic stack            FlistHeader    ->  hls ->  hls ->  hls
  57.  
  58.                                             |       |       |
  59.                           __________________|       v       v
  60.                          |
  61.                          |
  62.                          v
  63.  
  64.         (hyperlinks hlinks list)    FlistHeader ->  hl  ->  hl  ->  hl
  65.                         (hlinks_info |view hypertxt.c 188)          (hlink |view hypertxt.c 183)
  66.                          |
  67.                          |
  68.                     hps  |-----------------------|  hpNo
  69.                          |                       |
  70.                          v                       v
  71.  
  72.         (hyperpages hpages list)    FlistHeader ->  hp  ->  hp  ->  hp
  73.                         (hpages_info |view hypertxt.c 178)          (hpage |view hypertxt.c 173)
  74.  
  75.  
  76.  
  77.         The major functions of hypertxt.c are shown below.
  78.  
  79.  
  80.             loadhps() |view hypertxt.c 211        Loads hypertext file into a FlexList
  81.                             of hyperpages.
  82.  
  83.             puthp() |view hypertxt.c 382            Displays current hyperpage and builds
  84.                             a FlexList of the hyperlinks displayed
  85.                             if the address of a Flist variable is
  86.                             passed.
  87.  
  88.             puthps() |view hypertxt.c 732        This is the program's main control loop.
  89.                             The topic stack is a local variable of
  90.                             this function.
  91.  
  92.         Other interesting functions are shown below.
  93.  
  94.             strvec() |view hypertxt.c 334        Convert a string of tokens to an array of
  95.                             character pointers.
  96. topic stack
  97.  
  98.       --------------
  99.       !  topics    !  (Flist Flist|flexlist.htx)            STACK OF PENDING TOPICS
  100.       --------------
  101.             !            !--!
  102.             !            ! _!_
  103.             !            ! \!/              (FlistNode FlistNode|flexlist.htx)
  104.            \!/           !  `
  105.       ----------------   !      --------      --------      --------
  106.       ! front        ! --!----> ! next ! ---> ! next ! ---> ! next ! ----!
  107.       !--------------!   !      !------!      !------!      !------!     !
  108.       ! current      ! --!  !-- ! prev ! <--- ! prev ! <--- ! prev !     !
  109.       !--------------!      !   !------!      !------!      !------!    _!_
  110.       ! rear         ! --!  !   ! hls hlinks list  !      ! hls  !      ! hls  !    \!/
  111.       !--------------!   ! _!_  --------      --------      --------     `
  112.       ! ncurrent   0 !   ! \!/                          ,
  113.       !--------------!   !  `                                 /!\
  114.       ! nodes      3 !   !                                     !
  115.       !--------------!   !_____________________________________!
  116.       ! ndlen      * !
  117.       !--------------!
  118.       ! hdlen      0 !    (FlistHeader FlistHeader|flexlist.htx)      * depends on data model
  119.       ----------------
  120.  
  121. hlinks list
  122.       --------------
  123.       !  hls       !  (Flist Flist|flexlist.htx)            LIST OF HYPERLINKS
  124.       --------------
  125.             !            _________________________
  126.             !            !                       !          (FlistNode FlistNode|flexlist.htx)
  127.            \!/           !                      \!/
  128.       ----------------   !      --------      --------      --------
  129.       ! front        ! --!----> ! next ! ---> ! next ! ---> ! next ! ---!
  130.       !--------------!   !      !------!      !------!      !------!    !
  131.       ! current      ! --!  !-- ! prev ! <--- ! prev ! <--- ! prev !    !
  132.       !--------------!      !   !------!      !------!      !------!   _!_
  133.       ! rear         ! --!  !   ! txt  !      ! txt  !      ! txt  !   \!/
  134.       !--------------!   ! _!_  ! topic!      ! topic!      ! topic!    `
  135.       ! ncurrent   2 !   ! \!/  ! scrX !      ! scrX !      ! scrX !
  136.       !--------------!   !  `   ! scrY !      ! scrY !      ! scrY !
  137.       ! nodes      3 !   !      --------      --------      --------
  138.       !--------------!   !      (hlink |view hypertxt.c 183)                              /!\
  139.       ! ndlen      * !   !_____________________________________!
  140.       !--------------!
  141.       ! hdlen      * !   (FlistHeader FlistHeader|flexlist.htx)        * depends on data model
  142.       !--------------!
  143.       ! hps hpages list, hpNo    !  (hlinks_info |view hypertxt.c 188)
  144.       ----------------
  145. hpages list
  146.       --------------
  147.       !  hps       !  (Flist Flist|flexlist.htx)            LIST OF HYPERPAGES
  148.       --------------
  149.             !            _________________________
  150.             !            !                       !          (FlistNode FlistNode|flexlist.htx)
  151.            \!/           !                      \!/
  152.       ----------------   !      --------      --------      --------
  153.       ! front        ! --!----> ! next ! ---> ! next ! ---> ! next ! ---!
  154.       !--------------!   !      !------!      !------!      !------!    !
  155.       ! current      ! --!  !-- ! prev ! <--- ! prev ! <--- ! prev !    !
  156.       !--------------!      !   !------!      !------!      !------!   _!_
  157.       ! rear         ! --!  !   ! topic!      ! topic!      ! topic!   \!/
  158.       !--------------!   ! _!_  ! fpos !      ! fpos !      ! fpos !    `
  159.       ! ncurrent   2 !   ! \!/  --------      --------      --------
  160.       !--------------!   !  `    (hpage |view hypertxt.c 173)                      /!\
  161.       ! nodes      3 !   !                                     !
  162.       !--------------!   !                                     !
  163.       ! ndlen      * !   !_____________________________________!
  164.       !--------------!
  165.       ! hdlen      * !    (FlistHeader FlistHeader|flexlist.htx)        * depends on data model
  166.       !--------------!
  167.       ! fname, refs  !    (hpages_info |view hypertxt.c 178)
  168.       ----------------
  169.