June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
10
Task/File-input-output/Forth/file-input-output-2.fth
Normal file
10
Task/File-input-output/Forth/file-input-output-2.fth
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
: INPUT$ ( text -- n n )
|
||||
pad swap accept pad swap ;
|
||||
cr ." Enter file name : " 20 INPUT$ w/o create-file throw Value fd-out
|
||||
: get-content cr ." Enter your nickname : " 20 INPUT$ fd-out write-file cr ;
|
||||
: close-output ( -- ) fd-out close-file throw ;
|
||||
get-content
|
||||
\ Inject a carriage return at end of file
|
||||
s\" \n" fd-out write-file
|
||||
close-output
|
||||
bye
|
||||
Loading…
Add table
Add a link
Reference in a new issue