This is G o o g l e's cache of http://home.earthlink.net/~neilbawd/dosfile.html.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:1paIXtvidQIC:home.earthlink.net/~neilbawd/dosfile.html+&hl=en&ie=UTF-8


Google is not affiliated with the authors of this page nor responsible for its content.

DOSFILE

DOSFILE

Wil Baden 1998-12-23

DOSFILE             ( Line Filter )
Make the contents of clipboard a PC file.
MACFILE             ( Line Filter )
Make the contents of clipboard a Mac File.
UNIXFILE            ( Line Filter )
Make the contents of clipboard a Unix File.

Needs CLIPBOARD

Needs from Tool Belt #EOL-Character   /SPLIT   ANDIF   NOT   PLACE  

TEXT Program Text 1
10 CONSTANT #LINEFEED-CHAR

: Set-Line-Terminator     ( src . -- )
    2DUP BEGIN  DUP WHILE          ( src . str len)
        OVER C@ #EOL-CHAR = NOT
        ANDIF  OVER C@ #LINEFEED-CHAR = NOT  THEN
    WHILE  1 /STRING  REPEAT THEN
    /SPLIT TYPE                    ( src .)
    DUP IF
        PAD COUNT TYPE
        OVER C@ #EOL-CHAR = IF
            DUP 1 > ANDIF OVER 1+ C@ #LINEFEED-CHAR = THEN
                IF  1 /STRING  THEN
        THEN
        1 /STRING
    THEN ;

: Create-Line-Terminator  ( "name" -- )
    CREATE
    DOES>
    COUNT PAD PLACE
    CLIPBOARD BEGIN  DUP WHILE Set-Line-Terminator  REPEAT
    2DROP ;

Create-Line-Terminator DOS-LINE-TERMINATOR
    2 C,  #EOL-CHAR C,  #LINEFEED-CHAR C,

Create-Line-Terminator MAC-LINE-TERMINATOR
    1 C,  #EOL-CHAR C,

Create-Line-Terminator UNIX-LINE-TERMINATOR
    1 C,  #LINEFEED-CHAR C,

: DOSFILE  7 Backspaces  DOS-LINE-TERMINATOR  ;
: MACFILE  7 Backspaces  MAC-LINE-TERMINATOR  ;
: UNIXFILE 8 Backspaces  UNIX-LINE-TERMINATOR  ;


Go back to Neil Bawd's home page.