home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST917.PRG < prev    next >
Encoding:
Text File  |  1989-10-02  |  4.3 KB  |  177 lines

  1. *********************
  2.  
  3. PROCEDURE Topichelp
  4.  
  5.    PARAMETERS var1, var2, var3
  6.  
  7.    scrcursor = IF( TYPE("scrcursor") = "U", .T., scrcursor)
  8.    scrhname  = IF( TYPE("scrhname")  = "U", "INHELP", scrhname)
  9.    scrprog   = IF( TYPE("scrprog")   = "U", "C:", scrprog)
  10.  
  11.    Setkeyoff()
  12.  
  13.    IF PCOUNT() = 0
  14.       && This came from the Onhelp system
  15.       && and not from the idenpendant system
  16.    ELSE
  17.       IF !FILE(scrprog + "\" + scrhname + ".DBF")  && No help file
  18.          Wpush(0,0,4,79,0)
  19.          @ Wrow(2), Wcol(2) SAY "There is no help file.  Any key to continue.."
  20.          INKEY(0)
  21.          Wpop()
  22.          Setkeyon()
  23.          RETURN
  24.       ELSE
  25.          _helpret = SELECT()
  26.          SELECT 0
  27.          _hrow = ROW()
  28.          _hcol = COL()
  29.          _hcolor = SETCOLOR()
  30.          USE (scrprog + "\" + scrhname) INDEX (scrprog + "\" + scrhname) ALIAS Help
  31.       ENDIF
  32.    ENDIF
  33.  
  34.    SEEK "START HERE"
  35.  
  36.    PRIVATE top_point[10], top_filt[10]
  37.    AFILL(top_point, 0)
  38.    AFILL(top_filt, "")
  39.  
  40.    IF !FOUND()
  41.       * Display some warning message
  42.       USE
  43.       SELECT (_helpret)
  44.       SETCOLOR( _hcolor )
  45.       @ _hrow, _hcol SAY ""
  46.    ELSE
  47.  
  48.       SET WRAP ON
  49.       topiclevel = 1
  50.       top_filt[topiclevel] = ""
  51.       top_point[topiclevel] = RECNO()
  52.  
  53.       Showtopic("_" + TRIM(Help->more_text))
  54.  
  55.       * Allow them to pick the topic from the screen
  56.  
  57.       IF PCOUNT() = 3
  58.          USE
  59.          SELECT (_helpret)
  60.          SETCOLOR( _hcolor )
  61.          @ _hrow, _hcol SAY ""
  62.       ENDIF
  63.    ENDIF
  64.    Setkeyon()
  65.    SET CURSOR (scrcursor)
  66.       
  67. *********************
  68.  
  69. PROCEDURE Showtopic
  70.  
  71.    PARAMETERS t_filt
  72.  
  73.    IF topiclevel > 10   && There is a limit to everything!
  74.       RETURN
  75.    ELSE
  76.       topiclevel = topiclevel + 1
  77.    ENDIF
  78.  
  79.    withwindow = (!EMPTY(Help->top) .AND. !EMPTY(Help->left))
  80.  
  81.    IF EMPTY(Help->bottom) .AND. EMPTY(Help->right)
  82.    ELSE
  83.       IF withwindow
  84.          Windowpush(Help->top, Help->left, Help->bottom, Help->right)
  85.       ENDIF
  86.    ENDIF
  87.  
  88.    top_filt[topiclevel] = TRIM(t_filt)
  89.  
  90.    SET FILTER TO TRIM(Help->lookit) = top_filt[topiclevel]
  91.  
  92.    SEEK top_filt[topiclevel]
  93.  
  94.    IF !EMPTY(Help->bottom) .AND. !EMPTY(Help->right)
  95.       IF withwindow
  96.          SETCOLOR(IF( !EMPTY(Help->helpcolor), Help->helpcolor, SETCOLOR() ) )
  97.          Windowpush(Help->top, Help->left, Help->bottom, Help->right)
  98.       ENDIF
  99.    ENDIF
  100.    
  101.    SET FILTER TO TRIM(Help->lookit) = top_filt[topiclevel] .AND. ( EMPTY(Help->bottom) .AND. EMPTY(Help->right) )
  102.  
  103.    SEEK top_filt[topiclevel]
  104.  
  105.    top_point[topiclevel] = RECNO()
  106.    DO WHILE .T.
  107.       GO top_point[topiclevel]
  108.  
  109.       which = Topicpmpts(RECNO())
  110.  
  111.       GO top_point[topiclevel]
  112.  
  113.       IF !EMPTY(which)
  114.          which = (which - 1)
  115.          FOR devil = 1 TO which
  116.             SKIP
  117.          NEXT
  118.          IF "|" $ Help->more_text
  119.             oldfilt = DBFILTER()
  120.             SET FILTER TO 
  121.             item     = Help->more_text
  122.             irec     = RECNO()
  123.             SEEK item
  124.             IF FOUND()
  125.                oldcolor = SETCOLOR()
  126.                SETCOLOR(TRIM(Help->helpcolor))
  127.                SET CURSOR ON
  128.                Wpush(Help->top, Help->left, Help->bottom, Help->right)
  129.                MEMOEDIT(Help->helpscr, Help->top+1, Help->left+1, Help->bottom-1, Help->right-1, .F.)
  130.                Wpop()
  131.                SET CURSOR OFF
  132.                SETCOLOR(oldcolor)
  133.             ENDIF
  134.             GO irec
  135.             SET FILTER TO TRIM(Help->lookit) = top_filt[topiclevel] .AND. ( EMPTY(Help->bottom) .AND. EMPTY(Help->right) )
  136.  
  137.          ELSEIF !EMPTY(Help->more_text)
  138.  
  139.             Showtopic("_" + TRIM(Help->more_text))
  140.  
  141.             SET FILTER TO TRIM(Help->lookit) = top_filt[topiclevel] .AND. ( EMPTY(Help->bottom) .AND. EMPTY(Help->right) )
  142.             GO TOP
  143.  
  144.          ENDIF
  145.       ELSE
  146.          EXIT
  147.       ENDIF
  148.    ENDDO
  149.    IF withwindow
  150.       Windowpop()
  151.    ENDIF
  152.    topiclevel = topiclevel - 1
  153.    GO top_point[topiclevel]
  154.  
  155. ********************
  156.  
  157. FUNCTION Topicpmpts
  158.  
  159.    PARAMETERS _righthere
  160.  
  161.    _others = Help->counter
  162.    _un     = 1
  163.  
  164.    FOR _do = _un TO _others
  165.       _say = TRIM(Help->helpscr)
  166.       Parsing(@_say, "[")
  167.       _say = SUBSTR(_say, 1, LEN(_say)-1)
  168.       @ Help->top, Help->left PROMPT _say
  169.       SKIP
  170.    NEXT
  171.    _temp = 1
  172.    GO _righthere
  173.    MENU TO _temp
  174.    RETURN(_temp)
  175.  
  176. * End of File
  177.