1 line
7.0 KiB
Plaintext
1 line
7.0 KiB
Plaintext
|
\ BLK2TXT - Information Convert forth screen files to ascii text. \ BLK2TXT - Load screen FORTH DEFINITIONS DECIMAL APPLICATION 2 LOAD \ compile program TURNKEY MAIN BLK2TXT \ create turnkey application \ BLK2TXT - HELP ARGV GETARG \ Show help : HELP ( -- ) ." Usage: BLK2TXT file[.SCR] file[.TXT]" CR ." Convert Forth screen files to ASCII text." CR ; \ Parse blank delimited argument from commandline. : ARGV ( n -- adr u -1 | 0 ) 0 0 ROT 128 COUNT ROT 0 ?DO 2NIP BL SKIP 2DUP BL SCAN ROT OVER - -ROT LOOP 2DROP DUP IF -1 ELSE AND THEN ; \ Get argument, if none show help and exit : GETARG ( n -- adr u ) ARGV 0= IF HELP ABORT THEN ; --> \ BLK2TXT - F1 F2 FERROR H1 H2 \ Filename buffers CREATE F1 80 ALLOT CREATE F2 80 ALLOT \ Display filename and exit : FERROR ( adr -- ) COUNT TYPE ABORT ; \ File handles VARIABLE H1 VARIABLE H2 -->
|