home *** CD-ROM | disk | FTP | other *** search
- \ SEQTOBLK.SEQ Convert from Sequential file to Blocks. by Tom Zimmer
-
-
- : ?writerror ( f1 --- )
- if cr ." Error Writing to " shndl+ count type
- shndl+ hclose drop
- then ;
-
- : transblk ( --- )
- ascii \ pad c!
- pad 64 shndl+ hwrite 64 - ?writerror
- 14 0
- do lineread dup count 2- 64 min 0 max + 64 blank
- 1+ 64 shndl+ hwrite 64 - ?writerror
- loop pad 1+ 64 shndl+ hwrite 64 - ?writerror
- ." ." outbuf c@ 0= ;
-
- : conv ( --- )
- cr ." Only converts files with extension .SEQ"
- cr ." New files are created with a .SCR extension."
- cr ." DONOT specify the file extension."
- cr ." Filename to convert? "
- query bl word $hopen abort" Couldn't Open file!"
- shndl @ shndl+ $>handle
- " SCR" ">$ shndl+ $>ext
- shndl+ hcreate abort" Couldn't Create the .SCR file."
- pad 1024 blank
- pad 1024 shndl+ hwrite 1024 - ?writerror
- inlen off
- begin transblk
- until shndl+ hclose drop
- shndl @ hclose drop ;
-
-
-
-
-