home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / FFB.ZIP / FFUTILS.ARC / ZIMMER.ARC / SEQTOBLK.SEQ < prev    next >
Encoding:
Text File  |  1987-11-16  |  1.3 KB  |  38 lines

  1. \ SEQTOBLK.SEQ  Convert from Sequential file to Blocks. by Tom Zimmer
  2.  
  3.  
  4. : ?writerror    ( f1 --- )
  5.                 if      cr ." Error Writing to " shndl+ count type
  6.                         shndl+ hclose drop
  7.                 then    ;
  8.  
  9. : transblk      ( --- )
  10.                 ascii \ pad c!
  11.                 pad 64 shndl+ hwrite 64 - ?writerror
  12.                 14 0
  13.                 do      lineread dup count 2- 64 min 0 max + 64 blank
  14.                         1+ 64 shndl+ hwrite 64 - ?writerror
  15.                 loop    pad 1+ 64 shndl+ hwrite 64 - ?writerror
  16.                         ." ." outbuf c@ 0= ;
  17.  
  18. : conv          ( --- )
  19.                 cr ." Only converts files with extension .SEQ"
  20.                 cr ." New files are created with a .SCR extension."
  21.                 cr ." DONOT specify the file extension."
  22.                 cr ." Filename to convert? "
  23.                 query bl word $hopen abort" Couldn't Open file!"
  24.                 shndl @ shndl+ $>handle
  25.                 " SCR" ">$ shndl+ $>ext
  26.                 shndl+ hcreate abort" Couldn't Create the .SCR file."
  27.                 pad 1024 blank
  28.                 pad 1024 shndl+ hwrite 1024 - ?writerror
  29.                 inlen off
  30.                 begin   transblk
  31.                 until   shndl+ hclose drop
  32.                         shndl @ hclose drop ;
  33.  
  34.  
  35.  
  36.  
  37.  
  38.