Diff for /gforth/kernel/io.fs between versions 1.7 and 1.8

version 1.7, 1998/12/11 22:54:31 version 1.8, 1999/02/03 00:10:25
Line 42  has? os [IF] Line 42  has? os [IF]
 undef-words  undef-words
           
 Defer type ( c-addr u -- ) \ core  Defer type ( c-addr u -- ) \ core
     \G If u>0, display u characters from a string starting with the character
     \G stored at c-addr.
 : (type)  BEGIN  dup  WHILE  : (type)  BEGIN  dup  WHILE
     >r dup c@ (emit) 1+ r> 1-  REPEAT  2drop ;      >r dup c@ (emit) 1+ r> 1-  REPEAT  2drop ;
   
 [IFDEF] (type) ' (type) IS Type [THEN]  [IFDEF] (type) ' (type) IS Type [THEN]
   
 Defer emit ( c -- ) \ core  Defer emit ( c -- ) \ core
     \G Display the character associated with character value c.
 : (emit) ( c -- ) \ gforth  : (emit) ( c -- ) \ gforth
     0 emit-file drop \ !! use ?DUP-IF THROW ENDIF instead of DROP ?      0 emit-file drop \ !! use ?DUP-IF THROW ENDIF instead of DROP ?
 ;  ;
Line 84  all-words Line 87  all-words
   
 : bell  #bell emit [ has? os [IF] ] outfile-id flush-file drop [ [THEN] ] ;  : bell  #bell emit [ has? os [IF] ] outfile-id flush-file drop [ [THEN] ] ;
 : cr ( -- ) \ core  : cr ( -- ) \ core
     \ emit a newline    \G Output a carriage-return and (if appropriate for the host operating system)
     \G a line feed.
 [ has? crlf [IF] ]      #cr emit #lf emit   [ has? crlf [IF] ]      #cr emit #lf emit 
 [ [ELSE] ]              #lf emit  [ [ELSE] ]              #lf emit
 [ [THEN] ]  [ [THEN] ]
     ;      ;
   
 : space bl emit ;  : space ( -- ) \ core
     \G Display one space.
     bl emit ;
   
 has? ec [IF]  has? ec [IF]
 : spaces 0 max 0 ?DO space LOOP ;  : spaces ( n -- ) \ core
     \G If n > 0, display n spaces. 
     0 max 0 ?DO space LOOP ;
 : backspaces  0 max 0 ?DO  #bs emit  LOOP ;  : backspaces  0 max 0 ?DO  #bs emit  LOOP ;
 [ELSE]  [ELSE]
 \ space spaces                                          21mar93py  \ space spaces                                          21mar93py
 decimal  decimal
 Create spaces ( u -- ) \ core  Create spaces ( u -- ) \ core
 bl 80 times \ times from target compiler! 11may93jaw    \G If n > 0, display n spaces. 
     bl 80 times \ times from target compiler! 11may93jaw
 DOES>   ( u -- )  DOES>   ( u -- )
     swap    swap
     0 max 0 ?DO  I' I - &80 min 2dup type  +LOOP  drop ;    0 max 0 ?DO  I' I - &80 min 2dup type  +LOOP  drop ;
 Create backspaces  Create backspaces
 08 80 times \ times from target compiler! 11may93jaw    08 80 times \ times from target compiler! 11may93jaw
 DOES>   ( u -- )  DOES>   ( u -- )
    swap    swap
    0 max 0 ?DO  I' I - &80 min 2dup type  +LOOP  drop ;    0 max 0 ?DO  I' I - &80 min 2dup type  +LOOP  drop ;
 hex  hex
 [THEN]  [THEN]
   

Removed from v.1.7  
changed lines
  Added in v.1.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>