home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / snip0693.zip / OPENLIST.PRG < prev    next >
Text File  |  1993-04-18  |  2KB  |  57 lines

  1. /*
  2.     OPENLIST.PRG
  3.     Author: Phil Barnett (Clipper Echo)
  4.     Modified by E. Givler 3/15/93
  5.     Calls: name2hdl() - ASM function.
  6.  
  7. */
  8. FUNCTION open_list
  9. local x, indx
  10. local crlf   := chr(13)+chr(10)
  11. local hndls  := 0
  12. local txt    := ''
  13. local inarea := SELECT()
  14. local inscr  := savescreen(0,0,24,79)
  15. local cidxname, nHand
  16.  
  17.     // Step through the work areas.
  18.     FOR x := 1 TO 250
  19.  
  20.         IF ! empty(ALIAS(x))
  21.  
  22.             SELECT( x )
  23.             txt += 'Area  : ' + STR(x,3) + ;
  24.                    IF(x==inarea,' (Active) ','') + crlf
  25.             txt += 'Alias : ' + ALIAS() + crlf
  26.             txt += 'Handle: ' + STR( name2hdl(PADR( alias(), 8) + 'DBF'),3) + crlf
  27.             txt += replicate(CHR(196),25)+crlf
  28.             hndls++
  29.             indx := 1
  30.  
  31.             // List index keys for this area.
  32.             DO WHILE ! EMPTY( OrdName( indx ) )
  33.                 cidxname := UPPER(PADR(OrdName( indx ),8) + RIGHT( OrdBagExt(), 3))
  34.                 txt += 'Index : ' + OrdName( indx ) + OrdBagExt() + CRLF
  35.                 txt += '  Key : ' + indexkey(indx) + crlf
  36.                 txt += 'Handle: ' + STR(name2hdl( cIdxname ), 3) + CRLF
  37.                 indx++
  38.                 hndls++
  39.             ENDDO
  40.             txt += replicate(CHR(205),77)+crlf
  41.         ENDIF
  42.  
  43.     NEXT x
  44.     txt += 'DBF/NTX Handles used = '+STR(hndls,3)
  45.  
  46.     dispbox(0,0,24,79)
  47.     memoedit(txt,1,1,23,78)
  48.     SELECT(inarea)
  49.     restscreen(0,0,24,79,inscr)
  50.  
  51.     if (nHand := fcreate('handles.log') ) != -1
  52.          fwrite(nHand, txt )
  53.          fclose( nHand )
  54.     endif
  55.  
  56. RETURN NIL
  57.