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