home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / CLIPPER / SLSW / SF.PRG < prev    next >
Text File  |  1993-12-01  |  20KB  |  664 lines

  1. *:*********************************************************************
  2. *:
  3. *:        Program: SF.PRG
  4. *:
  5. *:         System: Super.Lib Library for Clipper
  6. *:         Author: Garry Prefontaine
  7. *:      Copyright (c) 1989, Garry Prefontaine
  8. *:  Last modified: 12/12/89     11:27
  9. *:
  10. *:  Procs & Fncts: PAINT_SF()
  11. *:               : SF_SHOW()
  12. *:               : SF_PICKDBF()
  13. *:               : COPYITOUT()
  14. *:               : SF_APPEND()
  15. *:               : SF_PICKND()
  16. *:               : SF_ORDER()
  17. *:               : SF_OPENEM()
  18. *:               : PICK_NDX()
  19. *:
  20. *:          Calls: INITSUP()      (function in SUPER.LIB)
  21. *:               : CAPSLOCK()     (function in SUPER.LIB)
  22. *:               : PULLDN()       (function in SUPER.LIB)
  23. *:               : MSG()          (function in SUPER.LIB)
  24. *:               : MESSYN()       (function in SUPER.LIB)
  25. *:               : MODIS()        (function in SUPER.LIB)
  26. *:               : BLDNDX()       (function in SUPER.LIB)
  27. *:               : GLOBREP()      (function in SUPER.LIB)
  28. *:               : EDITDB()       (function in SUPER.LIB)
  29. *:               : DOITALL()      (function in SUPER.LIB)
  30. *:               : LISTER()       (function in SUPER.LIB)
  31. *:               : DUPLOOK()      (function in SUPER.LIB)
  32. *:               : CLABEL()       (function in SUPER.LIB)
  33. *:               : FORMLETR()     (function in SUPER.LIB)
  34. *:               : SUM_AVE()      (function in SUPER.LIB)
  35. *:               : OCCUR()        (function in SUPER.LIB)
  36. *:               : SETCOLORS()    (function in SUPER.LIB)
  37. *:               : INITCOL()      (function in SUPER.LIB)
  38. *:               : FULLDIR()      (function in SUPER.LIB)
  39. *:               : PAINT_SF()     (function  in SF.PRG)
  40. *:               : SF_SHOW()      (function  in SF.PRG)
  41. *:               : SF_PICKDBF()   (function  in SF.PRG)
  42. *:               : COPYITOUT()    (function  in SF.PRG)
  43. *:               : SF_APPEND()    (function  in SF.PRG)
  44. *:               : SF_PICKND()    (function  in SF.PRG)
  45. *:               : SF_ORDER()     (function  in SF.PRG)
  46. *:               : SF_OPENEM()    (function  in SF.PRG)
  47. *:
  48. *:      Documented 12/12/89 at 11:32                SNAP!  version 3.12e
  49. *:*********************************************************************
  50.  
  51. *- initialize metafunctions
  52. initsup()
  53.  
  54. *- define type of index
  55. defindex = '*'+Indexext()
  56.  
  57.  
  58. *- set caps on
  59. capslock(.T.)
  60.  
  61. *- initialize some variables
  62. isfopen = .F.
  63. STORE '' TO dbfname,ndx_string,query_exp
  64. ndx_order = 1
  65.  
  66. *- set some sets
  67. SET TALK OFF
  68. SET ECHO OFF
  69. SET CONFIRM OFF
  70. SET BELL OFF
  71. SET SAFETY OFF
  72. SET SCOREBOARD OFF
  73. SET TYPEAHEAD TO 50
  74. EXTERNAL kbd_escape
  75. EXTERNAL fastform
  76.  
  77. *- initialize SF arrays for holding
  78. *- indexes in current directory
  79. DECLARE sf_ndxs[adir(defindex)+1]
  80. *- active indexes
  81. DECLARE sf_acndx[6]
  82.  
  83.  
  84. *- set color
  85. Setcolor(c_normcol)
  86.  
  87.  
  88. *- draw the screen
  89. paint_sf()
  90.  
  91.  
  92. *- menu choice definitions
  93. PRIVATE choices[6]
  94. choices[1] = "Datafiles:Use Datafile:Define New Datafile:Modify Existing Datafile Definition:Copy records out:Append records in"
  95. choices[2] = "Indices:Select Indices:Index order:New Index"
  96. choices[3] = "Editing:Field Replacement:Tabular Edit:Vertical Edit"
  97. choices[4] = "Reporting:Build Query:Print Lists:Hunt Duplicates:Create Labels:Write Form Letters:Sum or Average a Field:Field Occurrance"
  98. choices[5] = "Other:List text file:Design Screen Appearance:Change Directory"
  99. choices[6] = "Quit:Quit:Author:Info"
  100. sf_sel = 1.01
  101.  
  102. *- define menu boxes
  103. PRIVATE boxdata[7]
  104. boxdata[1] = !(ISCOLOR())      && draw the top bar box ?
  105. boxdata[2] = m->c_normcol      && top bar color string
  106. boxdata[3] = m->c_popmenu      && drop box color
  107. boxdata[4] = m->c_frame        && drop box frame
  108. boxdata[5] = 3                 && drop box shadow position (1,3,7,9,0)
  109. boxdata[6] = m->c_shadatt      && drop box shadow attribute
  110. boxdata[7] = 0                 && row # of menu bar
  111.  
  112.  
  113. DO WHILE .T.
  114.    sf_show()                   && display dbfs and indexes
  115.    
  116.    
  117.    *- do the menu
  118.    sf_sel = pulldn(m->sf_sel,m->choices,m->boxdata)
  119.    
  120.    
  121.    *- if 0 returned, selection is QUIT
  122.    IF m->sf_sel = 0
  123.       m->sf_sel = 6.01
  124.    ENDIF
  125.    
  126.    
  127.    *- do the action corresponding to the menu choice
  128.    DO CASE
  129.    CASE m->sf_sel = 1.01     && select a DBF
  130.       
  131.       IF Adir('*.dbf') > 0
  132.          sf_pickdbf()
  133.       ELSE
  134.          msg("No DBFs detected in this directory")
  135.       ENDIF
  136.       
  137.       
  138.    CASE m->sf_sel = 1.02   && create structure
  139.       
  140.       IF messyn("Datafiles will be closed while defining new datafile","Continue","Quit",10,10)
  141.          modis("C")
  142.          CLOSE DATA
  143.          isfopen = .F.
  144.          dbfname = ''
  145.       ENDIF
  146.       
  147.       
  148.    CASE m->sf_sel = 1.03   && modify structure
  149.       IF messyn("Datafiles will be closed while modifying datafile","Continue","Quit",10,10)
  150.          modis("M")
  151.          CLOSE DATA
  152.          isfopen = .F.
  153.          dbfname = ''
  154.       ENDIF
  155.       
  156.       *- rest of options below 5 require dbf open
  157.    CASE m->sf_sel < 5  .AND. !m->isfopen
  158.       msg("Need a DBf open for this option")
  159.       
  160.       
  161.    CASE m->sf_sel = 1.04   && copy records out
  162.       copyitout()
  163.       
  164.    CASE m->sf_sel = 1.05   && append records in
  165.       sf_append()
  166.       
  167.    CASE m->sf_sel =2.01                && select indices
  168.       IF Adir(m->defindex) > 0
  169.          sf_picknd()
  170.       ENDIF
  171.       
  172.    CASE m->sf_sel = 2.02   .AND. !EMPTY(m->ndx_string)  && index order
  173.       
  174.       sf_order()          && change index order
  175.       
  176.    CASE m->sf_sel = 2.03        && make temp index
  177.       inname = bldndx()
  178.       IF !EMPTY(m->inname)
  179.          Ains(m->sf_acndx,1)    && insert in active index array
  180.          sf_acndx[1] = Alltrim(m->inname)+Indexext()
  181.          
  182.          sf_openem()            && reopen indexes
  183.          ndx_order = 1
  184.       ENDIF
  185.       
  186.    CASE m->sf_sel = 3.01            && global replace
  187.       globrep()
  188.       
  189.    CASE m->sf_sel = 3.02            && horizontal edit
  190.       editdb(.T.)
  191.       
  192.    CASE m->sf_sel = 3.03            && vertical edit
  193.       PRIVATE opts[2],procs[2]      && build arrays for 'Other' menu
  194.       opts[1]="Single Formletter"
  195.       opts[2]="Quit"
  196.       procs[1] = "FASTFORM"
  197.       procs[2] = ""
  198.       doitall(m->opts,m->procs)
  199.       
  200.    CASE m->sf_sel = 4.01            && query
  201.       query_exp = QUERY()
  202.       
  203.       
  204.    CASE m->sf_sel = 4.02            && print list
  205.       lister()
  206.       
  207.    CASE m->sf_sel = 4.03            && hunt duplicates
  208.       duplook()
  209.       
  210.       *- open index files again
  211.       sf_openem()
  212.       
  213.    CASE m->sf_sel = 4.04            && labels
  214.       clabel()
  215.       
  216.    CASE m->sf_sel = 4.05        && form letter
  217.       formletr()
  218.       
  219.    CASE m->sf_sel = 4.06     && sum/AVERAGE
  220.       IF messyn("Sum or Average?","Sum","Average")
  221.          sum_ave()
  222.       ELSE
  223.          sum_ave("AVE")
  224.       ENDIF
  225.       
  226.       
  227.    CASE m->sf_sel = 4.07    && occurance
  228.       occur()
  229.       
  230.    CASE m->sf_sel = 5.01    && list text file
  231.       Fileread()
  232.       
  233.       
  234.    CASE m->sf_sel = 5.02            && color setting
  235.       setcolors()
  236.       RESTORE FROM COLORS.MEM ADDIT
  237.       SET COLOR TO (m->c_normcol)
  238.       paint_sf()                    && repaint screen
  239.       
  240.       *- redefine menu box data
  241.       boxdata[1] = !(ISCOLOR())
  242.       boxdata[2] = m->c_normcol
  243.       boxdata[3] = m->c_popmenu
  244.       boxdata[4] = m->c_frame
  245.       boxdata[5] = m->c_shadpos
  246.       boxdata[6] = m->c_shadatt
  247.       boxdata[7] = 0
  248.       
  249.       
  250.    CASE m->sf_sel = 5.03  && dir picker
  251.       IF fulldir()
  252.          CLOSE DATA
  253.          isfopen = .F.
  254.          query_exp=''
  255.          paint_sf()
  256.       ENDIF
  257.       
  258.       
  259.    CASE m->sf_sel = 6.01            && quit
  260.       IF messyn('Are you sure?')
  261.          SET CURSOR ON
  262.          CLEAR
  263.          EXIT
  264.       ENDIF
  265.       
  266.    CASE m->sf_sel = 6.02
  267.       msg(" Super.Lib Library for Clipper","","Written by Garry A Prefontaine","920 N Washington","Edmond, Oklahoma, 73034","(405) 340-1940","Copyright (c) 1989, Garry A Prefontaine")
  268.       
  269.    CASE m->sf_sel = 6.03
  270.       
  271.       msg(" This program was written to demonstrate the capabilities",;
  272.          "of the Super.Lib Library for Clipper. The library is available",;
  273.          "from: ",;
  274.          "          Functional Software",;
  275.          "          920 N Washington",;
  276.          "          Edmond, OK, 73034",;
  277.          "          (405) 340-1940  ",;
  278.          "",;
  279.          "for $47.50. Source code is included.")
  280.       
  281.    ENDCASE
  282. ENDDO
  283.  
  284.  
  285. *!*********************************************************************
  286. *!
  287. *!       Function: SF_PICKDBF()
  288. *!
  289. *!      Called by: SF.PRG                        
  290. *!
  291. *!          Calls: POPEX()        (function in SUPER.LIB)
  292. *!               : MSG()          (function in SUPER.LIB)
  293. *!               : DELARRAY()     (function in SUPER.LIB)
  294. *!
  295. *!           Uses: (M->DBFPICK).DBF
  296. *!
  297. *!*********************************************************************
  298. FUNCTION sf_pickdbf
  299. dbfpick = popex('*.dbf')
  300. IF !EMPTY(m->dbfpick)
  301.    USE (m->dbfpick)
  302.    IF EMPTY(ALIAS())
  303.       msg("UNABLE TO OPEN DATABASE  - POSSIBLY CORRUPT OR .DBT FILE MISSING  ")
  304.       RETURN ''
  305.    ENDIF
  306.    
  307.    *- set globals
  308.    isfopen = .T.
  309.    query_exp = ''
  310.    dbfname = m->dbfpick
  311.    delarray(m->sf_acndx)    && delete index array
  312.    ndx_string=''
  313.    
  314. ENDIF
  315. RETURN ''
  316. *!*********************************************************************
  317. *!
  318. *!       Function: SF_PICKND()
  319. *!
  320. *!      Called by: SF.PRG                        
  321. *!
  322. *!          Calls: DELARRAY()     (function in SUPER.LIB)
  323. *!               : PICK_NDX()     (function  in SF.PRG)
  324. *!               : SF_OPENEM()    (function  in SF.PRG)
  325. *!
  326. *!*********************************************************************
  327. FUNCTION sf_picknd
  328.  
  329. delarray(m->sf_acndx)    && delete index array
  330. Adir(m->defindex,m->sf_ndxs)
  331. pick_ndx()        && get a list of active indices into sf_acndx
  332. sf_openem()       && open them
  333. RETURN ''
  334.  
  335. *!*********************************************************************
  336. *!
  337. *!       Function: SF_ORDER()
  338. *!
  339. *!      Called by: SF.PRG                        
  340. *!
  341. *!          Calls: MCHOICE()      (function in SUPER.LIB)
  342. *!
  343. *!*********************************************************************
  344. FUNCTION sf_order
  345. PRIVATE old_o
  346. old_o = m->ndx_order
  347. ndx_order = mchoice('sf_acndx',10,10,20,50)
  348. IF m->ndx_order = 0
  349.    ndx_order = m->old_o
  350. ELSE
  351.    SET ORDER TO (m->ndx_order)
  352. ENDIF
  353. RETURN ''
  354.  
  355. *!*********************************************************************
  356. *!
  357. *!       Function: SF_OPENEM()
  358. *!
  359. *!      Called by: SF.PRG                        
  360. *!               : SF_PICKND()    (function  in SF.PRG)
  361. *!
  362. *!          Calls: ALENG()        (function in SUPER.LIB)
  363. *!
  364. *!        Indexes: (SF_ACNDX[1]).NDX
  365. *!               : (SF_ACNDX[2]).NDX
  366. *!               : (SF_ACNDX[3]).NDX
  367. *!               : (SF_ACNDX[4]).NDX
  368. *!               : (SF_ACNDX[5]).NDX
  369. *!               : (SF_ACNDX[6]).NDX
  370. *!
  371. *!*********************************************************************
  372. FUNCTION sf_openem
  373. PRIVATE tindex[6]
  374.  
  375. afill(m->tindex,"")
  376. ndx_string = ''
  377. PRIVATE knt,I
  378. knt = aleng(m->sf_acndx)
  379. FOR I = 1 TO M->KNT
  380.    ndx_string = m->ndx_string+sf_acndx[m->i]+' '
  381.    tindex[m->i] = sf_acndx[m->i]
  382. NEXT
  383. SET INDEX TO (tindex[1]),(tindex[2]),(tindex[3]),(tindex[4]),(tindex[5]),(tindex[6])
  384. SET ORDER TO (m->ndx_order)
  385. RETURN ''
  386.  
  387. *!*********************************************************************
  388. *!
  389. *!       Function: PICK_NDX()
  390. *!
  391. *!      Called by: SF_PICKND()    (function  in SF.PRG)
  392. *!
  393. *!          Calls: TEMPID[ADIR()  (function in SUPER.LIB)
  394. *!               : KBD_ESCAPE.PRG
  395. *!               : MAKEBOX()      (function in SUPER.LIB)
  396. *!               : NKEY()         (function in SUPER.LIB)
  397. *!               : MSG()          (function in SUPER.LIB)
  398. *!               : UNBOX()        (function in SUPER.LIB)
  399. *!
  400. *!*********************************************************************
  401. FUNCTION pick_ndx
  402.  
  403. PRIVATE nwin,nextndx,pr_el,n_name
  404. PRIVATE tempid[adir(m->defindex)+1]
  405.  
  406.  
  407. *- set up temp array for marking selected indexes
  408. Acopy(m->sf_ndxs,m->tempid)
  409.  
  410. *- make F10 seem like ESCAPE
  411. SET KEY -9 TO kbd_escape
  412.  
  413. *- draw the box
  414. nwin = makebox(1,20,17,50,m->c_normcol)
  415. @1,22 SAY  "[Select/Deselect Indices]"
  416. @17,22 SAY "[Press F10 when done   ]"
  417.  
  418. nextndx= 1
  419. pr_el = 1
  420. DO WHILE .T.
  421.    
  422.    *- get a selection
  423.    pr_el =  Achoice(2,21,16,49,m->tempid,'','',m->pr_el)
  424.    IF m->pr_el = 0
  425.       EXIT
  426.    ENDI
  427.    
  428.    *- if its not already marked, mark it
  429.    IF LEFT(tempid[m->pr_el],2)<>"√ "
  430.       n_name = sf_ndxs[m->pr_el]
  431.       
  432.       *- get index key to test
  433.       KEY = Alltrim(nkey(m->n_name))
  434.       IF !(TYPE("&KEY")== "U" .OR. TYPE("&KEY") == "UE")   && see if the index key will evaluate w/out ERRORS
  435.          tempid[m->pr_el] = '√ '+tempid[m->pr_el]
  436.          sf_acndx[m->nextNDX]   = sf_ndxs[m->pr_el]
  437.          nextndx = m->nextndx+ 1
  438.       ELSE
  439.          msg("That index either does not match the DBF","or this program does not support a function","in the index expression")
  440.          msg("For your info, the index expression is:",KEY)
  441.       ENDIF
  442.    ELSE    && otherwise, unmark it
  443.       tempid[m->pr_el] = SUBST(tempid[m->pr_el],3)
  444.       takeout = Ascan(m->sf_acndx,tempid[m->pr_el])
  445.       Adel(m->sf_acndx,m->takeout)
  446.       nextndx= m->nextndx- 1
  447.    ENDIF
  448.    
  449.    *- if we've got 6, that's all we made room for
  450.    IF m->nextndx = 7
  451.       EXIT
  452.    ENDIF
  453. ENDDO
  454.  
  455. SET KEY -9 TO
  456. unbox(m->nwin)
  457. RETURN ''
  458.  
  459.  
  460. *!*********************************************************************
  461. *!
  462. *!       Function: PAINT_SF()
  463. *!
  464. *!      Called by: SF.PRG                        
  465. *!
  466. *!          Calls: BXX()          (function in SUPER.LIB)
  467. *!               : STANDARD()     (function in SUPER.LIB)
  468. *!               : PRNT()         (function in SUPER.LIB)
  469. *!
  470. *!*********************************************************************
  471. FUNCTION paint_sf
  472.  
  473. Setcolor(m->c_normcol)
  474. CLEAR
  475. *- draw center box with C function bxx()
  476. bxx(2,0,18,79,standard(),0,0,'▒▒▒▒▒▒▒▒▒',50)
  477. IF !ISCOLOR()
  478.    bxx(19,0,24,79)
  479. ENDIF
  480. Setcolor(m->c_popcol)
  481. bxx(10,20,13,59,standard(),3,m->c_shadatt,'         ',50)
  482. *- print text with C function prnt()
  483. prnt(11,22,"Super.Lib  Demonstration Program",standard())
  484. prnt(12,34,"Version 1.51",standard())
  485. Setcolor(m->c_normmenu)
  486. RETURN ''
  487.  
  488.  
  489.  
  490. *!*********************************************************************
  491. *!
  492. *!       Function: COPYITOUT()
  493. *!
  494. *!      Called by: SF.PRG                        
  495. *!
  496. *!          Calls: MENU_V()       (function in SUPER.LIB)
  497. *!               : TAGIT()        (function in SUPER.LIB)
  498. *!               : MESSYN()       (function in SUPER.LIB)
  499. *!               : ONE_READ()     (function in SUPER.LIB)
  500. *!               : PLSWAIT()      (function in SUPER.LIB)
  501. *!               : MSG()          (function in SUPER.LIB)
  502. *!
  503. *!           Uses: (M->THE_DBF).DBF
  504. *!               : (M->NEWFILE).DBF
  505. *!
  506. *!*********************************************************************
  507. FUNCTION copyitout
  508.  
  509. *- get selection
  510. choice = menu_v("","Tag records to copy","Copy records meeting Query","Copy all","Forget it")
  511. DO CASE
  512. CASE m->choice = 1   && tag
  513.    DO WHILE .T.
  514.       PRIVATE tag[100]
  515.       tagit(m->tag)
  516.       IF messyn("Copy marked records to a DBF ?")
  517.          the_dbf = SPACE(12)
  518.          one_read("Name of datafile to copy to : ","the_dbf","@!")
  519.          IF EMPTY(m->the_dbf)
  520.             EXIT
  521.          ENDIF
  522.          the_dbf = Alltrim(m->the_dbf)
  523.          the_dbf =IIF(.NOT. ".DBF" $ m->the_dbf, m->the_dbf+".DBF",m->the_dbf)
  524.          
  525.          *- if it already exists, don't overwrite it
  526.          *- loop around and get another filespec
  527.          IF FILE(m->the_dbf)
  528.             IF messyn("Database "+m->the_dbf+" already exists - ","Use another name","Overwrite")
  529.                the_dbf = ''
  530.                LOOP
  531.             ENDIF
  532.          ENDIF
  533.          plswait(.T.,"Copying....")
  534.          COPY TO (m->the_dbf) FOR (Ascan(m->tag,RECNO())> 0)
  535.          plswait(.F.)
  536.       ENDIF
  537.       EXIT
  538.    ENDDO
  539. CASE choice = 2         && copy for query
  540.    IF EMPTY(m->query_exp)
  541.       msg("No Query set")
  542.       RETURN ''
  543.    ENDIF
  544.    PRIVATE newfile,tnf
  545.    newfile = SPACE(40)
  546.    one_read("New DBF file name (use PATH)                     ","newfile","@!")
  547.    IF LASTKEY() = 27
  548.       RETURN ''
  549.    ENDIF
  550.    newfile = Alltrim(m->newfile)
  551.    IF ! AT('.',m->newfile) > 0
  552.       newfile = m->newfile+'.dbf'
  553.    ENDIF
  554.    IF FILE(m->newfile)
  555.       IF !messyn(m->newfile+' already exists - overwrite?')
  556.          RETURN ''
  557.       ENDIF
  558.    ENDIF
  559.    plswait(.T.,"Copying....")
  560.    COPY TO (m->newfile) FOR &query_exp
  561.    plswait(.F.)
  562.    RETURN ''
  563.    
  564. CASE choice = 3         && copy all
  565.    DO WHILE .T.
  566.       the_dbf = SPACE(12)
  567.       one_read("Name of datafile to copy to : ","the_dbf","@!")
  568.       IF EMPTY(m->the_dbf)
  569.          EXIT
  570.       ENDIF
  571.       the_dbf = Alltrim(m->the_dbf)
  572.       the_dbf =IIF(.NOT. ".DBF" $ m->the_dbf, m->the_dbf+".DBF",m->the_dbf)
  573.       
  574.       *- if it already exists, don't overwrite it
  575.       *- loop around and get another filespec
  576.       IF FILE(m->the_dbf)
  577.          IF messyn("Database "+m->the_dbf+" already exists - ","Use another name","Overwrite")
  578.             the_dbf = ''
  579.             LOOP
  580.          ENDIF
  581.       ENDIF
  582.       plswait(.T.,"Copying....")
  583.       COPY TO (m->the_dbf)
  584.       plswait(.F.)
  585.       EXIT
  586.    ENDDO
  587.    
  588. CASE choice = 4  && quit
  589. ENDCASE
  590. RETURN ''
  591.  
  592. *!*********************************************************************
  593. *!
  594. *!       Function: SF_APPEND()
  595. *!
  596. *!      Called by: SF.PRG                        
  597. *!
  598. *!          Calls: POPEX()        (function in SUPER.LIB)
  599. *!               : MSG()          (function in SUPER.LIB)
  600. *!               : MESSYN()       (function in SUPER.LIB)
  601. *!
  602. *!           Uses: (M->TTDBF).DBF 
  603. *!               : &TTDBF         
  604. *!
  605. *!*********************************************************************
  606. FUNCTION sf_append
  607. PRIVATE ttdbf,presel
  608. ttdbf  =popex('*.dbf')
  609.  
  610. *- save query for this area
  611. prequ = m->query_exp
  612. IF !EMPTY(m->ttdbf) .AND. !(m->ttdbf=m->dbfname)
  613.    presel = SELE()
  614.    SELE 0
  615.    USE (m->ttdbf)
  616.    IF EMPTY(ALIAS())
  617.       msg("UNABLE TO OPEN DATABASE  - POSSIBLY CORRUPT OR .DBT FILE MISSING  ")
  618.       SELE (m->presel)
  619.       RETURN ''
  620.    ENDIF
  621.    appq = '.t.'
  622.    IF messyn("Append -","for Query Condition","All records")
  623.       *- build query for other area
  624.       appq = QUERY()
  625.       appq = IIF(EMPTY(m->appq),'.t.',m->appq)
  626.       query_exp = m->prequ
  627.       
  628.    ENDIF
  629.    USE
  630.    SELE (m->presel)
  631.    IF messyn("Go ahead with APPEND FROM "+m->ttdbf+" into "+dbfname+" ?")
  632.       APPEND FROM &ttdbf FOR &appq
  633.    ENDIF
  634. ENDIF
  635. RETURN ''
  636.  
  637. *!*********************************************************************
  638. *!
  639. *!       Function: SF_SHOW()
  640. *!
  641. *!      Called by: SF.PRG                        
  642. *!
  643. *!          Calls: DRIVE()        (function in SUPER.LIB)
  644. *!
  645. *!*********************************************************************
  646. FUNCTION sf_show
  647. *- display the dbfs and indices
  648. Scroll(20,1,23,78,0)
  649. IF m->isfopen
  650.    n_recs =IIF(!EMPTY(m->dbfname),' Containing '+Alltrim(STR(RECC()))+' RECORDS','')
  651.     @20,03 SAY   "Datafile in use   -  "+m->dbfname+m->n_recs
  652.    IF !EMPTY(m->ndx_string)
  653.       @21,03 SAY "Indices in use    -  "+m->ndx_string
  654.       @22,03 SAY "Controlling index -  "+sf_acndx[m->ndx_order]
  655.    ENDIF
  656. ENDIF
  657. @23,3 SAY        'Current Directory -  '+drive()+':'+Curdir()
  658. RETURN ''
  659. *: EOF: SF.PRG
  660.  
  661.  
  662.  
  663.  
  664.