home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Database / CLIPR502.DOS / SOURCE / SYS / GETSYS.PRG < prev    next >
Encoding:
Text File  |  1993-02-15  |  16.3 KB  |  910 lines

  1. /***
  2. *
  3. *  Getsys.prg
  4. *
  5. *  Standard Clipper 5.2 GET/READ Subsystem
  6. *
  7. *  Copyright (c) 1991-1993, Computer Associates International, Inc.
  8. *  All rights reserved.
  9. *
  10. *  This version adds the following public functions:
  11. *
  12. *     ReadKill( [<lKill>] )       --> lKill
  13. *     ReadUpdated( [<lUpdated>] ) --> lUpdated
  14. *     ReadFormat( [<bFormat>] )   --> bFormat | NIL
  15. *
  16. *  NOTE: compile with /m /n /w
  17. *
  18. */
  19.  
  20. #include "Inkey.ch"
  21. #include "Getexit.ch"
  22.  
  23. #define K_UNDO          K_CTRL_U
  24.  
  25.  
  26. //
  27. // State variables for active READ
  28. //
  29. STATIC sbFormat
  30. STATIC slUpdated := .F.
  31. STATIC slKillRead
  32. STATIC slBumpTop
  33. STATIC slBumpBot
  34. STATIC snLastExitState
  35. STATIC snLastPos
  36. STATIC soActiveGet
  37. STATIC scReadProcName
  38. STATIC snReadProcLine
  39.  
  40.  
  41. //
  42. // Format of array used to preserve state variables
  43. //
  44. #define GSV_KILLREAD       1
  45. #define GSV_BUMPTOP        2
  46. #define GSV_BUMPBOT        3
  47. #define GSV_LASTEXIT       4
  48. #define GSV_LASTPOS        5
  49. #define GSV_ACTIVEGET      6
  50. #define GSV_READVAR        7
  51. #define GSV_READPROCNAME   8
  52. #define GSV_READPROCLINE   9
  53.  
  54. #define GSV_COUNT          9
  55.  
  56.  
  57.  
  58. /***
  59. *
  60. *  ReadModal()
  61. *
  62. *  Standard modal READ on an array of GETs
  63. *
  64. */
  65. FUNCTION ReadModal( GetList, nPos )
  66.  
  67.    LOCAL oGet
  68.    LOCAL aSavGetSysVars
  69.  
  70.    IF ( VALTYPE( sbFormat ) == "B" )
  71.       EVAL( sbFormat )
  72.    ENDIF
  73.  
  74.    IF ( EMPTY( GetList ) )
  75.       
  76.       // S'87 compatibility
  77.       SETPOS( MAXROW() - 1, 0 )
  78.       RETURN (.F.)                  // NOTE
  79.  
  80.    ENDIF
  81.  
  82.    // Preserve state variables
  83.    aSavGetSysVars := ClearGetSysVars()
  84.  
  85.    // Set these for use in SET KEYs
  86.    scReadProcName := PROCNAME( 1 )
  87.    snReadProcLine := PROCLINE( 1 )
  88.  
  89.    // Set initial GET to be read
  90.    IF !( VALTYPE( nPos ) == "N" .AND. nPos > 0 )
  91.       nPos := Settle( Getlist, 0 )
  92.    ENDIF
  93.  
  94.    WHILE !( nPos == 0 )
  95.  
  96.       // Get next GET from list and post it as the active GET
  97.       PostActiveGet( oGet := GetList[ nPos ] )
  98.  
  99.       // Read the GET
  100.       IF ( VALTYPE( oGet:reader ) == "B" )
  101.          EVAL( oGet:reader, oGet )    // Use custom reader block
  102.       ELSE
  103.          GetReader( oGet )            // Use standard reader
  104.       ENDIF
  105.  
  106.       // Move to next GET based on exit condition
  107.       nPos := Settle( GetList, nPos )
  108.  
  109.    ENDDO
  110.  
  111.  
  112.    // Restore state variables
  113.    RestoreGetSysVars( aSavGetSysVars )
  114.  
  115.    // S'87 compatibility
  116.    SETPOS( MAXROW() - 1, 0 )
  117.  
  118.    RETURN ( slUpdated )
  119.  
  120.  
  121.  
  122. /***
  123. *
  124. *  GetReader()
  125. *
  126. *  Standard modal read of a single GET
  127. *
  128. */
  129. PROCEDURE GetReader( oGet )
  130.  
  131.    // Read the GET if the WHEN condition is satisfied
  132.    IF ( GetPreValidate( oGet ) )
  133.  
  134.       // Activate the GET for reading
  135.       oGet:setFocus()
  136.  
  137.       WHILE ( oGet:exitState == GE_NOEXIT )
  138.  
  139.          // Check for initial typeout (no editable positions)
  140.          IF ( oGet:typeOut )
  141.             oGet:exitState := GE_ENTER
  142.          ENDIF
  143.  
  144.          // Apply keystrokes until exit
  145.          WHILE ( oGet:exitState == GE_NOEXIT )
  146.             GetApplyKey( oGet, inkey( 0 ) )
  147.          ENDDO
  148.  
  149.          // Disallow exit if the VALID condition is not satisfied
  150.          IF ( !GetPostValidate( oGet ) )
  151.             oGet:exitState := GE_NOEXIT
  152.          ENDIF
  153.       ENDDO
  154.  
  155.       // De-activate the GET
  156.       oGet:killFocus()
  157.  
  158.    ENDIF
  159.  
  160.    RETURN
  161.  
  162.  
  163.  
  164. /***
  165. *
  166. *  GetApplyKey()
  167. *
  168. *  Apply a single INKEY() keystroke to a GET
  169. *
  170. *  NOTE: GET must have focus.
  171. *
  172. */
  173. PROCEDURE GetApplyKey( oGet, nKey )
  174.  
  175.    LOCAL cKey
  176.    LOCAL bKeyBlock
  177.  
  178.    // Check for SET KEY first
  179.    IF !( ( bKeyBlock := setkey( nKey ) ) == NIL )
  180.       GetDoSetKey( bKeyBlock, oGet )
  181.       RETURN                           // NOTE
  182.    ENDIF
  183.  
  184.    DO CASE
  185.    CASE ( nKey == K_UP )
  186.       oGet:exitState := GE_UP
  187.  
  188.    CASE ( nKey == K_SH_TAB )
  189.       oGet:exitState := GE_UP
  190.  
  191.    CASE ( nKey == K_DOWN )
  192.       oGet:exitState := GE_DOWN
  193.  
  194.    CASE ( nKey == K_TAB )
  195.       oGet:exitState := GE_DOWN
  196.  
  197.    CASE ( nKey == K_ENTER )
  198.       oGet:exitState := GE_ENTER
  199.  
  200.    CASE ( nKey == K_ESC )
  201.       IF ( SET( _SET_ESCAPE ) )
  202.          
  203.          oGet:undo()
  204.          oGet:exitState := GE_ESCAPE
  205.  
  206.       ENDIF
  207.  
  208.    CASE ( nKey == K_PGUP )
  209.       oGet:exitState := GE_WRITE
  210.  
  211.    CASE ( nKey == K_PGDN )
  212.       oGet:exitState := GE_WRITE
  213.  
  214.    CASE ( nKey == K_CTRL_HOME )
  215.       oGet:exitState := GE_TOP
  216.  
  217.  
  218. #ifdef CTRL_END_SPECIAL
  219.  
  220.    // Both ^W and ^End go to the last GET
  221.    CASE ( nKey == K_CTRL_END )
  222.       oGet:exitState := GE_BOTTOM
  223.  
  224. #else
  225.  
  226.    // Both ^W and ^End terminate the READ (the default)
  227.    CASE ( nKey == K_CTRL_W )
  228.       oGet:exitState := GE_WRITE
  229.  
  230. #endif
  231.  
  232.  
  233.    CASE ( nKey == K_INS )
  234.       SET( _SET_INSERT, !SET( _SET_INSERT ) )
  235.       ShowScoreboard()
  236.  
  237.    CASE ( nKey == K_UNDO )
  238.       oGet:undo()
  239.  
  240.    CASE ( nKey == K_HOME )
  241.       oGet:home()
  242.  
  243.    CASE ( nKey == K_END )
  244.       oGet:end()
  245.  
  246.    CASE ( nKey == K_RIGHT )
  247.       oGet:right()
  248.  
  249.    CASE ( nKey == K_LEFT )
  250.       oGet:left()
  251.  
  252.    CASE ( nKey == K_CTRL_RIGHT )
  253.       oGet:wordRight()
  254.  
  255.    CASE ( nKey == K_CTRL_LEFT )
  256.       oGet:wordLeft()
  257.  
  258.    CASE ( nKey == K_BS )
  259.       oGet:backSpace()
  260.  
  261.    CASE ( nKey == K_DEL )
  262.       oGet:delete()
  263.  
  264.    CASE ( nKey == K_CTRL_T )
  265.       oGet:delWordRight()
  266.  
  267.    CASE ( nKey == K_CTRL_Y )
  268.       oGet:delEnd()
  269.  
  270.    CASE ( nKey == K_CTRL_BS )
  271.       oGet:delWordLeft()
  272.  
  273.    OTHERWISE
  274.  
  275.       IF ( nKey >= 32 .AND. nKey <= 255 )
  276.  
  277.          cKey := CHR( nKey )
  278.  
  279.          IF ( oGet:type == "N" .AND. ( cKey == "." .OR. cKey == "," ) )
  280.             oGet:toDecPos()
  281.          ELSE
  282.             
  283.             IF ( SET( _SET_INSERT ) )
  284.                oGet:insert( cKey )
  285.             ELSE
  286.                oGet:overstrike( cKey )
  287.             ENDIF
  288.  
  289.             IF ( oGet:typeOut )
  290.                IF ( SET( _SET_BELL ) )
  291.                   ?? CHR(7)
  292.                ENDIF
  293.  
  294.                IF ( !SET( _SET_CONFIRM ) )
  295.                   oGet:exitState := GE_ENTER
  296.                ENDIF
  297.             ENDIF
  298.  
  299.          ENDIF
  300.  
  301.       ENDIF
  302.  
  303.    ENDCASE
  304.  
  305.    RETURN
  306.  
  307.  
  308.  
  309. /***
  310. *
  311. *  GetPreValidate()
  312. *
  313. *  Test entry condition (WHEN clause) for a GET
  314. *
  315. */
  316. FUNCTION GetPreValidate( oGet )
  317.  
  318.    LOCAL lSavUpdated
  319.    LOCAL lWhen := .T.
  320.  
  321.    IF !( oGet:preBlock == NIL )
  322.  
  323.       lSavUpdated := slUpdated
  324.  
  325.       lWhen := EVAL( oGet:preBlock, oGet )
  326.  
  327.       oGet:display()
  328.  
  329.       ShowScoreBoard()
  330.       slUpdated := lSavUpdated
  331.  
  332.    ENDIF
  333.  
  334.    IF ( slKillRead )
  335.       
  336.       lWhen := .F.
  337.       oGet:exitState := GE_ESCAPE       // Provokes ReadModal() exit
  338.  
  339.    ELSEIF ( !lWhen )
  340.       
  341.       oGet:exitState := GE_WHEN         // Indicates failure
  342.  
  343.    ELSE
  344.       
  345.       oGet:exitState := GE_NOEXIT       // Prepares for editing
  346.  
  347.    END
  348.  
  349.    RETURN ( lWhen )
  350.  
  351.  
  352.  
  353. /***
  354. *
  355. *  GetPostValidate()
  356. *
  357. *  Test exit condition (VALID clause) for a GET
  358. *
  359. *  NOTE: Bad dates are rejected in such a way as to preserve edit buffer
  360. *
  361. */
  362. FUNCTION GetPostValidate( oGet )
  363.  
  364.    LOCAL lSavUpdated
  365.    LOCAL lValid := .T.
  366.  
  367.  
  368.    IF ( oGet:exitState == GE_ESCAPE )
  369.       RETURN ( .T. )                   // NOTE
  370.    ENDIF
  371.  
  372.    IF ( oGet:badDate() )
  373.       oGet:home()
  374.       DateMsg()
  375.       ShowScoreboard()
  376.       RETURN ( .F. )                   // NOTE
  377.    ENDIF
  378.  
  379.    // If editing occurred, assign the new value to the variable
  380.    IF ( oGet:changed )
  381.       oGet:assign()
  382.       slUpdated := .T.
  383.    ENDIF
  384.  
  385.    // Reform edit buffer, set cursor to home position, redisplay
  386.    oGet:reset()
  387.  
  388.    // Check VALID condition if specified
  389.    IF !( oGet:postBlock == NIL )
  390.  
  391.       lSavUpdated := slUpdated
  392.  
  393.       // S'87 compatibility
  394.       SETPOS( oGet:row, oGet:col + LEN( oGet:buffer ) )
  395.  
  396.       lValid := EVAL( oGet:postBlock, oGet )
  397.  
  398.       // Reset S'87 compatibility cursor position
  399.       SETPOS( oGet:row, oGet:col )
  400.  
  401.       ShowScoreBoard()
  402.       oGet:updateBuffer()
  403.  
  404.       slUpdated := lSavUpdated
  405.  
  406.       IF ( slKillRead )
  407.          oGet:exitState := GE_ESCAPE      // Provokes ReadModal() exit
  408.          lValid := .T.
  409.  
  410.       ENDIF
  411.    ENDIF
  412.  
  413.    RETURN ( lValid )
  414.  
  415.  
  416.  
  417. /***
  418. *
  419. *  GetDoSetKey()
  420. *
  421. *  Process SET KEY during editing
  422. *
  423. */
  424. PROCEDURE GetDoSetKey( keyBlock, oGet )
  425.  
  426.    LOCAL lSavUpdated
  427.  
  428.    // If editing has occurred, assign variable
  429.    IF ( oGet:changed )
  430.       oGet:assign()
  431.       slUpdated := .T.
  432.    ENDIF
  433.  
  434.    lSavUpdated := slUpdated
  435.  
  436.    EVAL( keyBlock, scReadProcName, snReadProcLine, ReadVar() )
  437.  
  438.    ShowScoreboard()
  439.    oGet:updateBuffer()
  440.  
  441.    slUpdated := lSavUpdated
  442.  
  443.    IF ( slKillRead )
  444.       oGet:exitState := GE_ESCAPE      // provokes ReadModal() exit
  445.    ENDIF
  446.  
  447.    RETURN
  448.  
  449.  
  450.  
  451.  
  452.  
  453. /***
  454. *              READ services
  455. */
  456.  
  457.  
  458.  
  459. /***
  460. *
  461. *  Settle()
  462. *
  463. *  Returns new position in array of Get objects, based on:
  464. *     - current position
  465. *     - exitState of Get object at current position
  466. *
  467. *  NOTES: return value of 0 indicates termination of READ
  468. *         exitState of old Get is transferred to new Get
  469. *
  470. */
  471. STATIC FUNCTION Settle( GetList, nPos )
  472.  
  473.    LOCAL nExitState
  474.  
  475.    IF ( nPos == 0 )
  476.       nExitState := GE_DOWN
  477.    ELSE
  478.       nExitState := GetList[ nPos ]:exitState
  479.    ENDIF
  480.  
  481.    IF ( nExitState == GE_ESCAPE .or. nExitState == GE_WRITE )
  482.       RETURN ( 0 )               // NOTE
  483.    ENDIF
  484.  
  485.    IF !( nExitState == GE_WHEN )
  486.       // Reset state info
  487.       snLastPos := nPos
  488.       slBumpTop := .F.
  489.       slBumpBot := .F.
  490.    ELSE
  491.       // Re-use last exitState, do not disturb state info
  492.       nExitState := snLastExitState
  493.    ENDIF
  494.  
  495.    //
  496.    // Move
  497.    //
  498.    DO CASE
  499.    CASE ( nExitState == GE_UP )
  500.       nPos--
  501.  
  502.    CASE ( nExitState == GE_DOWN )
  503.       nPos++
  504.  
  505.    CASE ( nExitState == GE_TOP )
  506.       nPos       := 1
  507.       slBumpTop  := .T.
  508.       nExitState := GE_DOWN
  509.  
  510.    CASE ( nExitState == GE_BOTTOM )
  511.       nPos       := LEN( GetList )
  512.       slBumpBot  := .T.
  513.       nExitState := GE_UP
  514.  
  515.    CASE ( nExitState == GE_ENTER )
  516.       nPos++
  517.  
  518.    ENDCASE
  519.  
  520.    //
  521.    // Bounce
  522.    //
  523.    IF ( nPos == 0 )                       // Bumped top
  524.       IF ( !ReadExit() .and. !slBumpBot )
  525.          slBumpTop  := .T.
  526.          nPos       := snLastPos
  527.          nExitState := GE_DOWN
  528.       ENDIF
  529.  
  530.    ELSEIF ( nPos == len( GetList ) + 1 )  // Bumped bottom
  531.       IF ( !ReadExit() .and. !( nExitState == GE_ENTER ) .and. !slBumpTop )
  532.          slBumpBot  := .T.
  533.          nPos       := snLastPos
  534.          nExitState := GE_UP
  535.       ELSE
  536.          nPos := 0
  537.       ENDIF
  538.    ENDIF
  539.  
  540.    // Record exit state
  541.    snLastExitState := nExitState
  542.  
  543.    IF !( nPos == 0 )
  544.       GetList[ nPos ]:exitState := nExitState
  545.    ENDIF
  546.    
  547.    RETURN ( nPos )
  548.  
  549.  
  550.  
  551. /***
  552. *
  553. *  PostActiveGet()
  554. *
  555. *  Post active GET for ReadVar(), GetActive()
  556. *
  557. */
  558. STATIC PROCEDURE PostActiveGet( oGet )
  559.  
  560.    GetActive( oGet )
  561.    ReadVar( GetReadVar( oGet ) )
  562.  
  563.    ShowScoreBoard()
  564.  
  565.    RETURN
  566.  
  567.  
  568.  
  569. /***
  570. *
  571. *  ClearGetSysVars()
  572. *
  573. *  Save and clear READ state variables. Return array of saved values
  574. *
  575. *  NOTE: 'Updated' status is cleared but not saved (S'87 compatibility)
  576. */
  577. STATIC FUNCTION ClearGetSysVars()
  578.  
  579.    LOCAL aSavSysVars[ GSV_COUNT ]
  580.  
  581.    // Save current sys vars
  582.    aSavSysVars[ GSV_KILLREAD ]     := slKillRead
  583.    aSavSysVars[ GSV_BUMPTOP ]      := slBumpTop
  584.    aSavSysVars[ GSV_BUMPBOT ]      := slBumpBot
  585.    aSavSysVars[ GSV_LASTEXIT ]     := snLastExitState
  586.    aSavSysVars[ GSV_LASTPOS ]      := snLastPos
  587.    aSavSysVars[ GSV_ACTIVEGET ]    := GetActive( NIL )
  588.    aSavSysVars[ GSV_READVAR ]      := ReadVar( "" )
  589.    aSavSysVars[ GSV_READPROCNAME ] := scReadProcName
  590.    aSavSysVars[ GSV_READPROCLINE ] := snReadProcLine
  591.  
  592.    // Re-init old ones
  593.    slKillRead      := .F.
  594.    slBumpTop       := .F.
  595.    slBumpBot       := .F.
  596.    snLastExitState := 0
  597.    snLastPos       := 0
  598.    scReadProcName  := ""
  599.    snReadProcLine  := 0
  600.    slUpdated       := .F.
  601.  
  602.    RETURN ( aSavSysVars )
  603.  
  604.  
  605.  
  606. /***
  607. *
  608. *  RestoreGetSysVars()
  609. *
  610. *  Restore READ state variables from array of saved values
  611. *
  612. *  NOTE: 'Updated' status is not restored (S'87 compatibility)
  613. *
  614. */
  615. STATIC PROCEDURE RestoreGetSysVars( aSavSysVars )
  616.  
  617.    slKillRead      := aSavSysVars[ GSV_KILLREAD ]
  618.    slBumpTop       := aSavSysVars[ GSV_BUMPTOP ]
  619.    slBumpBot       := aSavSysVars[ GSV_BUMPBOT ]
  620.    snLastExitState := aSavSysVars[ GSV_LASTEXIT ]
  621.    snLastPos       := aSavSysVars[ GSV_LASTPOS ]
  622.  
  623.    GetActive( aSavSysVars[ GSV_ACTIVEGET ] )
  624.  
  625.    ReadVar( aSavSysVars[ GSV_READVAR ] )
  626.  
  627.    scReadProcName  := aSavSysVars[ GSV_READPROCNAME ]
  628.    snReadProcLine  := aSavSysVars[ GSV_READPROCLINE ]
  629.  
  630.    RETURN
  631.  
  632.  
  633.  
  634. /***
  635. *
  636. *  GetReadVar()
  637. *
  638. *  Set READVAR() value from a GET
  639. *
  640. */
  641. STATIC FUNCTION GetReadVar( oGet )
  642.  
  643.    LOCAL cName := UPPER( oGet:name )
  644.    LOCAL i
  645.  
  646.    // The following code includes subscripts in the name returned by
  647.    // this FUNCTIONtion, if the get variable is an array element
  648.    //
  649.    // Subscripts are retrieved from the oGet:subscript instance variable
  650.    //
  651.    // NOTE: Incompatible with Summer 87
  652.    //
  653.    IF !( oGet:subscript == NIL )
  654.       FOR i := 1 TO LEN( oGet:subscript )
  655.          cName += "[" + LTRIM( STR( oGet:subscript[i] ) ) + "]"
  656.       NEXT
  657.    END
  658.  
  659.    RETURN ( cName )
  660.  
  661.  
  662.  
  663.  
  664.  
  665. /***
  666. *              System Services
  667. */
  668.  
  669.  
  670.  
  671. /***
  672. *
  673. *  __SetFormat()
  674. *  
  675. *  SET FORMAT service
  676. *
  677. */
  678. PROCEDURE __SetFormat( b )
  679.    sbFormat := IF( VALTYPE( b ) == "B", b, NIL )
  680.    RETURN
  681.  
  682.  
  683.  
  684. /***
  685. *
  686. *  __KillRead()
  687. *
  688. *  CLEAR GETS service
  689. *
  690. */
  691. PROCEDURE __KillRead()
  692.    slKillRead := .T.
  693.    RETURN
  694.  
  695.  
  696.  
  697. /***
  698. *
  699. *  GetActive()
  700. *
  701. *  Retrieves currently active GET object
  702. */
  703. FUNCTION GetActive( g )
  704.  
  705.    LOCAL oldActive := soActiveGet
  706.  
  707.    IF ( PCOUNT() > 0 )
  708.       soActiveGet := g
  709.    ENDIF
  710.  
  711.    RETURN ( oldActive )
  712.  
  713.  
  714.  
  715. /***
  716. *
  717. *  Updated()
  718. *
  719. */
  720. FUNCTION Updated()
  721.    RETURN slUpdated
  722.  
  723.  
  724.  
  725. /***
  726. *
  727. *  ReadExit()
  728. *
  729. */
  730. FUNCTION ReadExit( lNew )
  731.    RETURN ( SET( _SET_EXIT, lNew ) )
  732.  
  733.  
  734.  
  735. /***
  736. *
  737. *  ReadInsert()
  738. *
  739. */
  740. FUNCTION ReadInsert( lNew )
  741.    RETURN ( SET( _SET_INSERT, lNew ) )
  742.  
  743.  
  744.  
  745. /***
  746. *              Wacky Compatibility Services
  747. */
  748.  
  749.  
  750. // Display coordinates for SCOREBOARD
  751. #define SCORE_ROW      0
  752. #define SCORE_COL      60
  753.  
  754.  
  755. /***
  756. *
  757. *  ShowScoreboard()
  758. *
  759. */
  760. STATIC PROCEDURE ShowScoreboard()
  761.  
  762.    LOCAL nRow
  763.    LOCAL nCol
  764.  
  765.    IF ( SET( _SET_SCOREBOARD ) )
  766.       nRow := ROW()
  767.       nCol := COL()
  768.  
  769.       SETPOS( SCORE_ROW, SCORE_COL )
  770.       DISPOUT( IF( SET( _SET_INSERT ), "Ins", "   " ) )
  771.       SETPOS( nRow, nCol )
  772.    ENDIF
  773.  
  774.    RETURN
  775.  
  776.  
  777.  
  778. /***
  779. *
  780. *  DateMsg()
  781. *
  782. */
  783. STATIC PROCEDURE DateMsg()
  784.  
  785.    LOCAL nRow
  786.    LOCAL nCol
  787.  
  788.    IF ( SET( _SET_SCOREBOARD ) )
  789.       
  790.       nRow := ROW()
  791.       nCol := COL()
  792.  
  793.       SETPOS( SCORE_ROW, SCORE_COL )
  794.       DISPOUT( "Invalid Date" )
  795.       SETPOS( nRow, nCol )
  796.  
  797.       WHILE ( NEXTKEY() == 0 )
  798.       END
  799.  
  800.       SETPOS( SCORE_ROW, SCORE_COL )
  801.       DISPOUT( SPACE( 12 ) )
  802.       SETPOS( nRow, nCol )
  803.  
  804.    ENDIF
  805.  
  806.    RETURN
  807.  
  808.  
  809.  
  810. /***
  811. *
  812. *  RangeCheck()
  813. *
  814. *  NOTE: Unused second param for 5.00 compatibility.
  815. *
  816. */
  817. FUNCTION RangeCheck( oGet, junk, lo, hi )
  818.  
  819.    LOCAL cMsg, nRow, nCol
  820.    LOCAL xValue
  821.  
  822.    IF ( !oGet:changed )
  823.       RETURN ( .T. )          // NOTE
  824.    ENDIF
  825.  
  826.    xValue := oGet:varGet()
  827.  
  828.    IF ( xValue >= lo .and. xValue <= hi )
  829.       RETURN ( .T. )          // NOTE
  830.    ENDIF
  831.  
  832.    IF ( SET(_SET_SCOREBOARD) )
  833.       
  834.       cMsg := "Range: " + LTRIM( TRANSFORM( lo, "" ) ) + ;
  835.             " - " + LTRIM( TRANSFORM( hi, "" ) )
  836.  
  837.       IF ( LEN( cMsg ) > MAXCOL() )
  838.          cMsg := SUBSTR( cMsg, 1, MAXCOL() )
  839.       ENDIF
  840.  
  841.       nRow := ROW()
  842.       nCol := COL()
  843.  
  844.       SETPOS( SCORE_ROW, MIN( 60, MAXCOL() - LEN( cMsg ) ) )
  845.       DISPOUT( cMsg )
  846.       SETPOS( nRow, nCol )
  847.  
  848.       WHILE ( NEXTKEY() == 0 )
  849.       END
  850.  
  851.       SETPOS( SCORE_ROW, MIN( 60, MAXCOL() - LEN( cMsg ) ) )
  852.       DISPOUT( SPACE( LEN( cMsg ) ) )
  853.       SETPOS( nRow, nCol )
  854.  
  855.    ENDIF
  856.  
  857.    RETURN ( .F. )
  858.  
  859.  
  860.  
  861. /***
  862. *
  863. *  ReadKill()
  864. *
  865. */
  866. FUNCTION ReadKill( lKill )
  867.  
  868.    LOCAL lSavKill := slKillRead
  869.  
  870.    IF ( PCOUNT() > 0 )
  871.       slKillRead := lKill
  872.    ENDIF
  873.  
  874.    RETURN ( lSavKill )
  875.  
  876.  
  877.  
  878. /***
  879. *
  880. *  ReadUpdated()
  881. *
  882. */
  883. FUNCTION ReadUpdated( lUpdated )
  884.    
  885.    LOCAL lSavUpdated := slUpdated
  886.    
  887.    IF ( PCOUNT() > 0 )
  888.       slUpdated := lUpdated
  889.    ENDIF
  890.  
  891.    RETURN ( lSavUpdated )
  892.       
  893.  
  894.  
  895. /***
  896. *
  897. *  ReadFormat()
  898. *
  899. */
  900. FUNCTION ReadFormat( b )
  901.    
  902.    LOCAL bSavFormat := sbFormat
  903.  
  904.    IF ( PCOUNT() > 0 )
  905.       sbFormat := b
  906.    ENDIF
  907.  
  908.    RETURN ( bSavFormat )
  909.       
  910.