home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a079 / 1.img / FPDG.LZH / VOL2NUM0 / DOCUMENT / DOCUMENT.APP (.txt) next >
Encoding:
MS Visual FoxPro App  |  1993-02-01  |  8.4 KB  |  150 lines

  1. The DOCUMENT.PRG program maintains a database file containing compressed documents. It packs a file and inserts the compressed file in a memo field. It also decompresses memo fields. This program makes use of the edilzssa.dll compression library (DLL) for Windows.  The edilzssa.dll library contains functions that perform file-to-file compress and decompress operations. This library is a shareware program provided by:
  2.   Eschalon Development Inc 
  3.   110-2 Renaissance Square
  4.   New Westminster,  BC, V3M 6K3 Canada, 
  5.   Tel: (604) 520-1543) 
  6. As for all shareware software, If you find this library useful, you can send a check to the vender to register the software and in appreciation, the developer will send you an improved version of the DLL library.
  7. The edilzssa.dll library uses an enhanced form of the LZSS compression algorithm. The LZSS algorithm is an improved variant of the dictionary-based compression LZ77 algorithm developed by Jacob Ziv and Abraham Lempel. 
  8. This DLL library was created for general use and can only be accessed within FoxPro 2.5 for Windows using the FOXTOOLS.FLL library.  The library consists of two functions: LZSSPackFile() compresses a file and LZSSUnPackFile() decompresses a file.
  9. The DOCUMENT.PRG  maintains the DOCUMENT.DBF database which contains a memo field and various document description fields. The structure of DOCUMENT.DBF is
  10.   Structure for table:  c:\foxprow\book\document.dbf
  11.   Number of data records:       5       
  12.   Date of last update:   01/13/93
  13.   Memo file block size:   64
  14.   Field   Field Name   Type        Width  Dec
  15.       1   TITLE        Character      40               
  16.       2   DATE         Date            8               
  17.       3   KEYWORDS     Character      50               
  18.       4   FILENAME     Character      40               
  19.       5   DOCUMENT     Memo           10               
  20. ** Total **                          149
  21. When DOCUMENT.PRG executes, it displays a dialog box (See Figure 21.1 in the Book) which allows you to edit fields in the database file. The form also contains push buttons that you can use designate which database maintenance operation you want to perform. The screen program, DOCUMENT.SPR, as presented in Listing 21.5, controls the display of the form. It was created using the FoxPro 2.5 for Windows Screen Builder.
  22. The push buttons in the document dialog box perform the following operations: 
  23. Next      Move to the next record
  24. Previous    Move to the previous record
  25. Top         Move to the first record in the database
  26. Bottom    Move to the last record in the database
  27. Add         Add a new record. An Open File dialog box appears. You choose a file. The file is compressed using the LZSSPackFile() function and placed in the memo field of the new record. The current date is used. Finally, you can edit the new record and add descriptive data.
  28. UnPack    The DOCUMENT memo field for the current record is transferred to a temporary file (crunch.tmp)  LZSSUnPackFile() is called to decompress file crunch.tmp file and write the decompressed document into the file designated by filename field for the current record.
  29. View    The DOCUMENT memo field is decompressed (Like UnPack button) into file VIEW.TMP. Then VIEW.TMP displays in an edit window.
  30. Exit    Program DOCUMENT exits.
  31. The  LZSSPackFile() and LZSSUnPackFile() library functions are called using functions in the FOXTOOLS.FLL library.  The RegFn() function is called to register either Function. Since the function has two arguments, the ArgTypes string will have a value of "CC". Both functions return an integer error code. Therefore, the ReturnType argument is assigned a value of "I". Finally, You will assign "edilzssa.dll" to the DLLName string.
  32. When either of the edilzssa.dll library functions are called and have successfully performed their duty, an irritating dialog box appears that reminds you to register the shareware by sending money to the vendor. The aggravating dialog box does not appear in the registered version.
  33. DOCUMENT
  34. FOXTOOLS
  35. DOCUMENT.SPR
  36. DOCUMENT
  37. STOPIT
  38. ADDNEW
  39. crunch.txt
  40. crunch.txt
  41. DOCFILE
  42. COMPRESS
  43. FILENAME
  44. DOCUMENT
  45. CRUNCH
  46. LZSSPACKFILE
  47. edilzssa.dll
  48. Unable to register edilzssa.dll file
  49. crunch.txt
  50. crunch.txt
  51. crunch.txt
  52. % Compression
  53. Error Number FF
  54. ... Compression not performed
  55. NAMEFILE
  56. REGNO
  57. REGFN
  58. SUCCESS
  59. CRUNCH
  60. yERRCODE
  61. CALLFN
  62. FILESIZE
  63. LZSSUnPACKFILE
  64. edilzssa.dll
  65.  already exists.
  66. LZSSUnPACKFILE
  67. edilzssa.dll
  68. Unable to register edilzssa.dll file
  69. crunch.txt
  70. Error Number FF
  71.  Occurred
  72. crunch.txt
  73. TARGET
  74. REGNO
  75. REGFN
  76. ERRCODE
  77. CALLFN
  78. CRUNCH
  79. crunch.txt
  80. crunch.txt
  81. crunch.txt
  82. VIEW.TMP
  83. VIEW.TMP
  84. .BMPF
  85. VIEW.TMP
  86. VIEW.TMP:
  87. MS Sans Serif
  88. CHOICE
  89. ADDNEW
  90. DOCUMENT
  91. CRUNCH
  92. DECOMP
  93. yFILENAME
  94. BITMAP
  95. STOPIT
  96. CFILE
  97. MHANDLE
  98. FSIZE
  99. ADDNEW
  100. COMPRESS
  101. DECOMP
  102. BUTTON
  103. FILESIZE
  104. TALKz
  105. COMPATIBLEz
  106. READBORDERz
  107. _qcz1d18aw
  108. MS Sans Serif
  109. Document
  110. _qcz1d18aw
  111. Title
  112. MS Sans Serif
  113. MS Sans Serif
  114. MS Sans Serif
  115. Keywords
  116. MS Sans Serif
  117. MS Sans Serif
  118. fffff
  119. Filename
  120. MS Sans Serif
  121. MS Sans Serif
  122. Date:
  123. MS Sans Serif
  124. MS Sans Serif
  125. @*HN \<Next;\<Previous;\<Top;\<Bottom;\<Add;\<Unpack;\<View;E\<xit
  126. _qcz1d18aw
  127. SET READBORDER &rborder
  128. CURRAREA
  129. TALKSTAT
  130. COMPSTAT
  131. RBORDER
  132. _QCZ1D18AWDOCUMENT
  133. WTITLE
  134. KEYWORDS
  135. FILENAME
  136. CHOICE
  137. BUTTON
  138. The DOCUMENT.PRG (and DOCUMENT.SPR) programs demonstrate how to use 
  139. FOXTOOLS to load a DLL library that compresses and decompresses files. 
  140. DOCUMENT.PRG maintains a database that contains compressed document
  141. memo fields
  142. f:\jebwin\vol2num0\document\
  143. DOCUMENT.ART
  144. f:\jebwin\vol2num0\document\document.prg
  145. h:\foxprow\
  146. DOCUMENT.FXP
  147. f:\jebwin\vol2num0\document\document.spr
  148. DOCUMENT.SPX
  149. README.TXT
  150.