home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / CLIPPER / NCCLIB.ZIP / NCCVIEW.ZIP / G_DATA.PRG < prev    next >
Text File  |  1993-12-12  |  20KB  |  681 lines

  1. //═══════════════════════════════════════════════════════╕
  2. //  Program .....: G_Data                                │
  3. //  CopyRight ...: 1993 National Computer Consultants    │
  4. //                 All rights are reserved.              │
  5. //  Author ......: Greg Rice                             │
  6. //═══════════════════════════════════════════════════════╛
  7.  
  8. #include "inkey.ch"
  9. #include "dbstruct.ch"
  10. #include "nccview.ch"
  11. #include "fileio.ch"
  12. #include "mouse.ch"
  13. #include "g_menu.ch"
  14.  
  15. #define BUFFER   250
  16. #define CRLF     Chr(13) + chr(10)
  17.  
  18. #define ON        1
  19. #define OFF       0
  20. #define TO_SAVE   1
  21. #define TO_OPEN   2
  22.  
  23.  
  24.  
  25.  
  26.  
  27. Function g_DataClose()
  28.  
  29.     dbCloseArea()
  30.     WinFilename( , "" )
  31.     WinIndexfiles( , {""} )
  32.     WinViewFields( , {""} )
  33.     WinViewStru( , {""} )
  34.     ShowBackGround()
  35.     OpenDesktop()
  36.  
  37. Return( NIL )
  38.  
  39.  
  40. Function g_DataOpen()
  41.  
  42.     local GetList   := {}                                       , ;
  43.           xFile     := "*.DBF" + space( BUFFER - 5 )            , ;
  44.           sCursor   := Set(_SET_CURSOR)                         , ;
  45.           nWorkArea := Current_Window()                         , ;
  46.           sColor    := SetColor()                               , ;
  47.           cScreen   := savescreen()                             , ;
  48.           scrn      := savescreen(maxrow()-5,0,maxrow(),79)     , ;
  49.           Mouse     := MouseSys()                               , ;
  50.           nPos      := 0                                        , ;
  51.           i
  52.  
  53.  
  54.     for i = 1 to len(windows())
  55.       if empty(alias(i))
  56.         nWorkArea := i
  57.         exit
  58.       endif
  59.     next
  60.  
  61.     SetColor( popup_color() )
  62.     WinBox(maxrow()-5,03,maxrow()-2,31,0,4,.t.)
  63.     @ maxrow()-4,05 say 'Open Database Window #' get nWorkArea pict '##'
  64.     @ maxrow()-3,05 say 'File: ' get xFile picture '@KS18'
  65.  
  66.     @ maxrow(),0 say ' Enter the database file name. Wildcards are Ok.' color 'w+/r'
  67.  
  68.     Set Cursor On
  69.     Read
  70.     Set( _SET_CURSOR, sCursor )
  71.     Setcolor( sColor )
  72.  
  73.     if lastkey() # K_ESC
  74.       if nWorkArea > 0 .and. nWorkArea < 11
  75.         While "?" $ xFile .or. "*" $ xFile
  76.           setcolor( popup_color() )
  77.           xFile := DirPick( xFile,,42 )
  78.           SetColor( sColor )
  79.         Enddo
  80.  
  81.         xFile := rtrim(trim(xFile))
  82.  
  83.         nPos := Rat( ".", xFile )
  84.  
  85.         xFile := SUBSTR(xFile, 1, nPos-1)
  86.  
  87.         if select(Substr(xFile,1,nPos-1)) != 0
  88.            SetColor( "W+/R" )
  89.            WinBox(9,19,15,62,,5,.t.)
  90.            @ 11,22 say 'This file is already open in a window.'
  91.            @ 13,24 say 'Click the mouse or press any key'
  92.  
  93.            Mouse:ClearButtons()
  94.            Mouse:Show()
  95.            While Mouse:Button == 0 .and. Mouse:Ascii == 0
  96.              Mouse:Update()
  97.            Enddo
  98.            Mouse:Hide()
  99.  
  100.            SetColor( sColor )
  101.  
  102.            restscreen(,,,,cScreen)
  103.  
  104.            Return( NIL )
  105.         endif
  106.  
  107.         if File( xFile ) .or. File( xFile + '.DBF' )
  108.           Sele (nWorkArea)
  109.           dbCloseArea()
  110.           WinFilename(nWorkArea , "" )
  111.           WinIndexfiles(nWorkArea , {""} )
  112.           WinViewFields(nWorkArea , {""} )
  113.           WinViewStru(nWorkArea , {""} )
  114.           Sele (nWorkArea)
  115.           if ffshare( xFile )
  116.             WinFilename(nWorkArea , uppe(ltrim(trim(xFile))) )
  117.             WinViewFields(nWorkArea , stru_load(dbstruct()) )
  118.             WinViewStru( nWorkArea, dbstruct() )
  119.             Window_Active( .t. )
  120.             Current_Window( nWorkArea )
  121.           endif
  122.         elseif ! lastkey() == K_ESC
  123.           NccMesg( 'File not Found... Press any key', maxrow(), 'center')
  124.  
  125.           Mouse:ClearButtons()
  126.           Mouse:Show()
  127.           While Mouse:Button == 0 .and. Mouse:Ascii == 0
  128.             Mouse:Update()
  129.           Enddo
  130.           Mouse:Hide()
  131.  
  132.         endif
  133.       endif
  134.     endif
  135.     SetColor( sColor )
  136.  
  137.     restscreen(maxrow()-5,0,maxrow(),79,scrn)
  138.  
  139. Return( NIL )
  140.  
  141.  
  142.  
  143. Function g_DispStru()
  144.  
  145.     local xh := setcolor(), scrn := savescreen(), n := {}, xTop
  146.  
  147.  
  148.     AEVAL(dbstruct(),{ |fi_stru| aadd(n,space(1)+;
  149.                                       padr(fi_stru[DBS_NAME],10,' ')+ ;
  150.                                       space(5)+fi_stru[DBS_TYPE]+space(5)+;
  151.                                       str(fi_stru[DBS_LEN],3)+space(5)+ ;
  152.                                       str(fi_stru[DBS_DEC],3)+' ') })
  153.  
  154.     setColor( popup_color() )
  155.  
  156.     xTop := int(((maxrow()/2) - 4 ))
  157.  
  158.     arraydsp( n, ;
  159.              'Fieldname   Type     Len     Dec', ;
  160.              'File Structure' ;
  161.              ,xTop,21,xTop+09,55, ;
  162.              0, ;
  163.              0, ;
  164.              .t., ;
  165.              , ;
  166.              { |o| dView_MouseReader(o,xTop,21,xTop+09,55) ;
  167.              } ;
  168.             )
  169.  
  170.  
  171.     restscreen(,,,,scrn)
  172.     setcolor( xh )
  173.  
  174.  
  175. Return( NIL )
  176.  
  177.  
  178. //───────────────────────────────────────────────────────────────────┐
  179. //  Function g_FView( fname, tophead, LineLength, TabOffset, start)  │
  180. //───────────────────────────────────────────────────────────────────┘
  181.  
  182. Function g_FView( fname, tophead, LineLength, TabOffset, start, mHelp )
  183.  
  184.   local x, v, h, nKey, scrn := savescreen( 1, 0, maxrow(), 79), ;
  185.         rscreen, handle, Mouse := MouseSys(), Button, Row, nPos, ;
  186.         Column, Escrn, sColor := SetColor(), GetList   := {}, ;
  187.         xTFile := "*.TXT" + space(13), sCursor := Set(_SET_CURSOR)
  188.  
  189.   local clr := {;
  190.                 "", ; // main
  191.                 "", ; // hBar
  192.                 "", ; // vBar
  193.                 "", ; // Ruler
  194.                 "", ; // hBarHighLight
  195.                 ""  ; // vBarHighLight
  196.                }
  197.  
  198.   ShowBackGround()
  199.  
  200.   start := 0
  201.  
  202.   if ! mHelp
  203.      @ maxrow(),0 say ' Enter the file name. Wildcards are ok.' color 'w+/r'
  204.  
  205.      SetColor( popup_color() )
  206.      WinBox(maxrow()-5,03,maxrow()-3,36,0,4,.t.)
  207.      @ maxrow()-4,05 say 'File Name :' get xTFile picture '@KS25'
  208.  
  209.      Set Cursor On
  210.      Read
  211.      Set( _SET_CURSOR, sCursor )
  212.      Setcolor( sColor )
  213.  
  214.      ShowBackGround()
  215.  
  216.      if LastKey() == K_ESC
  217.         restscreen( 1, 0, maxrow(), 79, scrn)
  218.         Return( NIL )
  219.      endif
  220.  
  221.      fname := ltrim(trim(xTFile))
  222.   endif
  223.  
  224.   if (handle := fopen(fname, FO_READ)) == -1
  225.  
  226.      @ maxrow(),0 say ' Select a Text file with the mouse or keyboard.' color 'w+/r'
  227.      sColor := Setcolor()
  228.      While "?" $ fname .or. "*" $ fname
  229.         setcolor( popup_color() )
  230.         fname := DirPick( fname,,44 )
  231.         SetColor( sColor )
  232.      Enddo
  233.      if LastKey() == K_ESC
  234.         restscreen( 1, 0, maxrow(), 79, scrn)
  235.         Return( NIL )
  236.      endif
  237.  
  238.      fname := ltrim(trim(fname))
  239.      nPos := Rat( ".", fname )
  240.      tophead := SUBSTR(fname, 1, nPos+4)
  241.  
  242.      if (handle := fopen(fname, FO_READ)) == -1
  243.         NccPopUp('\nUnable to Open File\nPress any key to continue...\n', ;
  244.                  Popup_Color(), 5 )
  245.         restscreen( 1, 0, maxrow(), 79, scrn)
  246.         Return( NIL )
  247.      endif
  248.   else
  249.      if (handle := fopen(fname, FO_READ)) == -1
  250.         NccPopUp('\nUnable to Open File\nPress any key to continue...\n', ;
  251.                  Popup_Color(), 5 )
  252.         restscreen( 1, 0, maxrow(), 79, scrn)
  253.         Return( NIL )
  254.      endif
  255.   endif
  256.  
  257.   if iscolor()
  258.     clr[1] := 'W+/B'
  259.     clr[2] := 'W+/R'
  260.     clr[3] := 'W+/R'
  261.     clr[4] := 'N/G'
  262.     clr[5] := 'GR+'
  263.     clr[6] := 'GR+'
  264.   else
  265.     clr[1] := 'N/W'
  266.     clr[2] := 'N/W'
  267.     clr[3] := 'N/W'
  268.     clr[4] := 'N/W'
  269.     clr[5] := 'N'
  270.     clr[6] := 'N'
  271.   endif
  272.  
  273.   SetColor(clr[1])
  274.  
  275.   WinBox(3,2,21,75,,4,.t.)
  276.  
  277.   @ 03,03 say "[■]═╡"
  278.   @row(),col() say " File Name: " + tophead color 'W/RB+'
  279.   @row(),col() say "╞"
  280.  
  281.   fseek(handle,start,0)
  282.  
  283.   x                  :=  dViewTXT():New(4,3,20,74,handle)
  284.   x:StatusBlock      :=  { || "" }
  285.   x:InverseColor     :=  setcolor()
  286.   x:TabDisplacement  :=  if(TabOffset == nil, 10, val(TabOffset) )
  287.   x:MaxLineLen       :=  if(LineLength == nil, 512, val(LineLength) )
  288.  
  289.   SetColor(clr[2])
  290.   v                  :=  NccVBar():New( 4,75,20,75, x:FileLen )
  291.   v:InverseColor     :=  clr[5]
  292.  
  293.   SetColor(clr[3])
  294.   h                  :=  NccHBar():New( 21,03,21,74, x:MaxLineLen - x:LeftPosition )
  295.   h:InverseColor     :=  clr[6]
  296.  
  297.   SetColor(clr[1])
  298.   x:Activate()
  299.   v:Activate()
  300.   h:Activate()
  301.  
  302.   @ maxrow(),0 say ' Use the  or PGUP/PGDN keys to Navigate or use the mouse on the corner arrows' color 'w+/r'
  303.  
  304.   Mouse:Activate()
  305.   Mouse:Delay := 0
  306.  
  307.   while .t.
  308.  
  309.     x:Stabilize()
  310.     SetColor(clr[1])
  311.     v:Update( x:FilePos )
  312.     h:Update( x:LeftPosition )
  313.  
  314.     Mouse:MouseRead()
  315.  
  316.     if Mouse:Ascii # 0
  317.       nKey := Mouse:Ascii
  318.     else
  319.       Button := Mouse:Button
  320.       Row    := Mouse:Row
  321.       Column := Mouse:Column
  322.  
  323.       Do Case
  324.         Case Button == 2
  325.            Exit
  326.         Case Button == 1 .and. Row == 3  .and. Column == 4
  327.            Exit
  328.         Case Button == 1 .and. Row == 4  .and. Column == 75
  329.            x:Home() ; x:Up()
  330.         Case Button == 1 .and. Row == 20 .and. Column == 75
  331.            x:End()  ; x:Down()
  332.         Case Button == 1 .and. Row == 21  .and. Column == 3
  333.            x:Left()      //  ; h:Update(x:LeftPosition)
  334.         Case Button == 1 .and. Row == 21 .and. Column == 74
  335.            x:Right()    //   ; h:Update(x:LeftPosition)
  336.  
  337.         Case Button == 1 .and. (  Row >= 4 .and. Row <= 19 .and. Column == 75 )
  338.  
  339.            if v:nOnBar > Row
  340.               x:Home() ; x:PageUp()     // x:Up(x:FilePos - Row)
  341.            else
  342.               x:End() ; x:PageDown()    // x:Down(Row - x:FilePos)
  343.            endif
  344.  
  345.       EndCase
  346.  
  347.       LOOP
  348.  
  349.     endif
  350.  
  351.     Do Case
  352.       Case nKey == K_ESC
  353.         exit
  354.       Otherwise
  355.         if nKey == K_DOWN .or. nKey == K_CTRL_PGDN .or. nKey == K_PGDN
  356.           x:End()
  357.         elseif nKey == K_UP .or. nKey == K_CTRL_PGUP .or. nKey == K_PGUP
  358.           x:Home()
  359.         elseif nKey == K_LEFT
  360.           x:Left()
  361.         elseif nKey == K_RIGHT
  362.           x:Right()
  363.         endif
  364.  
  365.         x:StandardKeys( nKey )
  366.  
  367.     EndCase
  368.   enddo
  369.  
  370.   fclose(handle)
  371.  
  372.   restscreen( 1, 0, maxrow(), 79, scrn)
  373. Return ( NIL )
  374.  
  375.  
  376.  
  377.  
  378. //────────────────────┐
  379. //  Create New DBF    │
  380. //────────────────────┘
  381.  
  382. Function g_DataNew( mNew )
  383.  
  384.     LOCAL nPickCount                                            , ;
  385.           fc                                                    , ;
  386.           i                                                     , ;
  387.           FullScreen                                            , ;
  388.           nBottom                                               , ;
  389.           reverse                                               , ;
  390.           d_Start                                               , ;
  391.           InsScreen                                             , ;
  392.           InsKey                                                , ;
  393.           InsBottom                                             , ;
  394.           pos                                                   , ;
  395.           scrn                                                  , ;
  396.           cColor        := SetColor()                           , ;
  397.           ok            := .f.                                  , ;
  398.           InsSele       := 0                                    , ;
  399.           nCounter      := 0                                    , ;
  400.           nFieldSele    := 0                                    , ;
  401.           nKey          := 0                                    , ;
  402.           aNewField     := ARRAY(1,4)                           , ;
  403.           aPickDisp     := {}                                   , ;
  404.           aPickFull     := {}                                   , ;
  405.           aPickRef      := {}                                   , ;
  406.           aNewStru      := {}                                   , ;
  407.           nExitKeys     := { 97, 65, K_F10, K_INS , K_DEL }     , ;
  408.           dbF_structure := ACLONE( WinViewStru() )              , ;
  409.           dbstruct      := dbstruct()                           , ;
  410.           mSelect       := Select()                             , ;
  411.           mFile         := ALIAS()
  412.  
  413. /*
  414.     if mNew                //  Empty(alias())
  415.        SELECT 11
  416.        CREATE nccviews.ext
  417.        * add first new field as yet undefined
  418.        APPEND BLANK
  419.        REPLACE field_name WITH "NewField", field_type WITH "C",;
  420.                field_len WITH 10,field_dec WITH 0
  421.        USE
  422.  
  423.        SELECT 11
  424.        CREATE xtemp.dbf FROM nccviews.ext
  425.        if File('nccviews.ext')
  426.           Delete File nccviews.ext
  427.        endif
  428.  
  429.        dbF_structure := dbstruct()
  430.        dbstruct := dbstruct()
  431.     else
  432.        if Empty(alias())
  433.           Return( NIL )
  434.        endif
  435.     endif
  436. */
  437.  
  438.     FullScreen := savescreen()
  439.  
  440.     ShowSelectBox(dbF_structure)
  441.  
  442.     setcolor(popup_color())
  443.     NccMesg('..LOADING..',07+min(maxrow()-14,len(dbF_structure)),'center,02,46')
  444.  
  445.     AEVAL(dbF_structure,{ |fi_stru| aadd(aPickDisp,space(7)+;
  446.                                          padr(fi_stru[DBS_NAME],10,' ')+ ;
  447.                                          space(4)+fi_stru[DBS_TYPE]+space(4)+;
  448.                                          str(fi_stru[DBS_LEN],3)+space(4)+ ;
  449.                                          str(fi_stru[DBS_DEC],3)+' '), ;
  450.                                          nCounter++ })
  451.  
  452.     AEVAL(dbstruct,{ |fi_stru| aadd(aPickFull,space(1)+;
  453.                                     padr(fi_stru[DBS_NAME],10,' ')+ ;
  454.                                     space(1)+fi_stru[DBS_TYPE]+space(1)+;
  455.                                     str(fi_stru[DBS_LEN],3)+space(1)+ ;
  456.                                     str(fi_stru[DBS_DEC],3)+' ') })
  457.  
  458.     nPickCount := 0
  459.  
  460.     WHILE len(aPickDisp) # 0
  461.       fc := ltrim(str(nCounter))
  462.       keyboard ''
  463.       nBottom := 05+min(maxrow()-14,nCounter)
  464.       nFieldSele := arraydsp( aPickDisp,;
  465.                               'Field List',;
  466.                               IF(nPickCount == 0,;
  467.                                 '',;
  468.                                 'Selections:'+ltrim(str(nPickCount))+'   ';
  469.                                 )+;
  470.                                   'Field Count:'+fc,;
  471.                               06,04,nBottom,43,nFieldSele,;
  472.                               IF(nFieldSele>((nBottom-6)/2)+1,;
  473.                                  int(((nBottom-6)/2)),;
  474.                                  nFieldSele-1;
  475.                                 ),;
  476.                               .f.,nExitKeys, ;
  477.                             { |o| dView_MouseReader(o,06,04,nBottom,43), ;
  478.                                   menu1Reader(o,06,04,nBottom,43) ;
  479.                             } ;
  480.                             )
  481.  
  482.       nKey := lastkey()
  483.  
  484.       Do Case
  485.         Case  nKey == K_RETURN
  486.  
  487.              FieldEdit( @aPickDisp, nFieldSele )
  488.  
  489.         Case nKey == K_INS .or. nKey == 48 .or. uppe(chr(nKey)) == 'A'
  490.  
  491.              aNewField[1][ DBS_NAME ] := "NEWFIELD2"
  492.              aNewField[1][ DBS_TYPE ] := "C"
  493.              aNewField[1][ DBS_LEN ]  := 10
  494.              aNewField[1][ DBS_DEC ]  := 0
  495.  
  496.              IF uppe(chr(nKey)) == 'A'
  497.  
  498.                 aadd(aPickDisp,space(7)+padr(aNewField[1,DBS_NAME],10,' ')+ ;
  499.                      space(4)+aNewField[1,DBS_TYPE]+space(4)+;
  500.                      str(aNewField[1,DBS_LEN],3)+space(4)+ ;
  501.                      str(aNewField[1,DBS_DEC],3)+' ')
  502.                 aadd(dbF_structure,{ "NEWFIELD2", "C", 10, 0 })
  503.                 nFieldSele := len(aPickDisp)
  504.  
  505.              ELSE
  506.                 aadd(aPickDisp,NIL)
  507.                 aadd(dbF_structure,NIL)
  508.                 ains(aPickDisp,nFieldSele)
  509.                 ains(dbF_structure,nFieldSele)
  510.                 aPickDisp[nFieldSele] := space(7)+;
  511.                      padr(aNewField[1,DBS_NAME],10,' ')+ ;
  512.                      space(4)+aNewField[1,DBS_TYPE]+space(4)+;
  513.                      str(aNewField[1,DBS_LEN],3)+space(4)+ ;
  514.                      str(aNewField[1,DBS_DEC],3)+' '
  515.                 dbF_structure[nFieldSele] := dbstruct[aNewField]
  516.  
  517.              END
  518.  
  519. //             InsSele := if(InsSele < len(aPickFull),InsSele+1,InsSele)
  520.              nCounter++
  521.  
  522.            restscreen(03,49,10+min(maxrow()-14,len(aPickFull)-1),79,InsScreen)
  523.            restscreen(,,,,FullScreen)
  524.            ShowSelectBox(dbF_structure)
  525.  
  526.         Case nKey == K_DEL .or. nKey == 46
  527.  
  528.            adel(dbF_structure,nFieldSele)
  529.            adel(aPickDisp,nFieldSele)
  530.            aSize(dbF_structure,len(dbF_structure)-1)
  531.            aSize(aPickDisp,len(aPickDisp)-1)
  532.            nCounter--
  533.            restscreen(0,0,maxrow(),maxcol(),FullScreen)
  534.            ShowSelectBox(dbF_structure)
  535.  
  536.         Case  nKey == K_F10
  537.  
  538.            NccMesg('     Wait...Creating table      ',07+min(maxrow()-14,nCounter),;
  539.                  'center,04,43')
  540.  
  541.            if File('ncctemp.dbf')
  542.               Delete File ncctemp.dbf
  543.            endif
  544.  
  545.            DBCREATE("ncctemp",dbF_structure)
  546.  
  547.            SELECT(mSelect)
  548.            USE
  549.  
  550.            SELECT 11
  551.            USE ncctemp
  552.  
  553.            APPEND FROM (mFile)
  554.  
  555.            mFile := mFile + ".dbf"
  556.  
  557.            if File(mFile)
  558.               Delete File (mFile)
  559.            endif
  560.  
  561.            USE
  562.  
  563.            RENAME 'ncctemp.dbf' TO (mFile)
  564.  
  565.            ok := .t.
  566.  
  567.            exit
  568.  
  569.         Otherwise
  570.  
  571.            exit
  572.  
  573.       EndCase
  574.  
  575.     END
  576.  
  577.  
  578.     IF ok
  579.        g_DataClose()
  580.     ELSE
  581.        restscreen(,,,,FullScreen)
  582.        SetColor( cColor )
  583.     ENDIF
  584.  
  585.  
  586.  
  587.  
  588. Return( NIL )
  589.  
  590.  
  591. STATIC Function seq( aArray,nRef )
  592.  
  593.     LOCAL ret_val := 0
  594.  
  595.     ret_val := ascan( aArray, nRef )
  596.  
  597. Return( if(ret_val == 0, space(4),str(ret_val,4,0)) )
  598.  
  599.  
  600.  
  601.  
  602. STATIC Function ShowSelectBox( aArray )
  603.  
  604.     setcolor(popup_color())
  605.     WinBox(03,02,08+min(maxrow()-14,len( aArray )),46,0,4)
  606.     WinBox(9+min(maxrow()-14,len( aArray )),02,12+min(maxrow()-14,len( aArray )),46,0,4)
  607.     shadow(03,02,12+min(maxrow()-14,len( aArray )),46)
  608.     NccMesg('<A-Add>  <Ins-Insert>  <Del-Delete>',10+min(maxrow()-14,len( aArray )),'center,03,45')
  609.     NccMesg('<Esc-Abort>                  <F10-Save>',11+min(maxrow()-14,len( aArray )),'center,03,45')
  610.  
  611. Return( NIL )
  612.  
  613.  
  614. STATIC Function menu1Reader(o,TopRow,LeftColumn,BottomRow,RightColumn)
  615.  
  616.     LOCAL row                                 , ;
  617.           col                                 , ;
  618.           button                              , ;
  619.           Mouse  := MouseSys()                , ;
  620.           nKey   := 0
  621.  
  622.  
  623.     row    := Mouse:Row
  624.     col    := Mouse:Column
  625.     button := Mouse:Button
  626.  
  627.     if lastkey() # 0
  628.       nKey := lastkey()
  629.     endif
  630.  
  631.     if button # 0
  632.       Do Case
  633.  
  634.         Case row == BottomRow+5 .and. col >= LeftColumn+3 .and. ;
  635.                                       col <= LeftColumn+9
  636.           nKey := asc('A')
  637.  
  638.         Case row == BottomRow+5 .and. col >= LeftColumn+12 .and. ;
  639.                                       col <= LeftColumn+23
  640.           nKey := K_INS
  641.  
  642.         Case row == BottomRow+5 .and. col >= LeftColumn+26 .and. ;
  643.                                       col <= LeftColumn+37
  644.           nKey := K_DEL
  645.  
  646.         Case row == BottomRow+6 .and. col >= LeftColumn+1 .and. ;
  647.                                       col <= LeftColumn+11
  648.           nKey := K_ESC
  649.  
  650.         Case row == BottomRow+6 .and. col >= LeftColumn+14 .and. ;
  651.                                       col <= LeftColumn+27
  652.           nKey := K_RETURN
  653.  
  654.         Case row == BottomRow+6 .and. col >= LeftColumn+30 .and. ;
  655.                                       col <= LeftColumn+39
  656.           nKey := K_F10
  657.  
  658.       EndCase
  659.     endif
  660.  
  661. //    keyboard chr(nKey)
  662.     inkey()
  663.  
  664. Return( nKey )
  665.  
  666.  
  667.  
  668. STATIC Function FieldEdit( aPickDisp, nFieldSele )
  669.  
  670. Local sCursor := Set( _SET_CURSOR ), GetList := {}
  671.  
  672.  
  673. @ row(), col() get aPickDisp[nFieldSele]
  674.  
  675. set cursor on
  676. Read
  677.  
  678. set( _SET_CURSOR, sCursor )
  679.  
  680. Return( NIL )
  681.