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