home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / amos_tips / pack / pack.amos / pack.amosSourceCode
Encoding:
AMOS Source Code  |  1992-03-02  |  1.0 KB  |  50 lines

  1. '********************************************* 
  2. '*                  Pack.AMOS                * 
  3. '*         ï¿½1992 by Volker Stepprath         * 
  4. '*  Crunched and saved a file in dataformat  * 
  5. '********************************************* 
  6. '
  7. '**** Choose file **** 
  8. '
  9. FILE$=Fsel$("","","Please choose file to pack !","")
  10. '
  11. If FILE$<>""
  12.   '
  13.   '**** Get length of file ****  
  14.   '
  15.   Open In 1,FILE$
  16.     L=Lof(1)
  17.   Close 1
  18.   '
  19.   '**** Reserve memory ****  
  20.   '
  21.   Reserve As Work 7,L
  22.   '
  23.   '**** Load file **** 
  24.   '
  25.   Bload FILE$,7
  26.   '
  27.   '**** Crunch file **** 
  28.   '
  29.   C= Extension_5_00CE(Start(7),L,-1,512,0)
  30.   '
  31.   '**** Write back file **** 
  32.   '
  33.   If C>0
  34.     Print "Normal length:"+Str$(L)
  35.     Print "Packed length:"+Str$(C)
  36.     Print "Gained.......:"+Str$(100-(100*C)/L)+"% ="+Str$(L-C)+" bytes"
  37.     FILE$=Fsel$("","","Please choose file to save","the packed datas !")
  38.     If FILE$<>""
  39.       Bsave FILE$,Start(7) To Start(7)+C
  40.     End If 
  41.   End If 
  42.   '
  43.   '**** Erase reserved memory **** 
  44.   '
  45.   Erase 7
  46.   '
  47. End If 
  48. '
  49. Wait 50
  50. Edit