Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
37
Task/File-input-output/S-BASIC/file-input-output.basic
Normal file
37
Task/File-input-output/S-BASIC/file-input-output.basic
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
comment
|
||||
Preserve file channel #0 (the console) while declaring channels
|
||||
#2 and #3 as sequential-access ASCII files.
|
||||
end
|
||||
files d, sa, sa
|
||||
var s = string:255
|
||||
based errcode = integer
|
||||
base errcode at 103H
|
||||
|
||||
comment
|
||||
CP/M expects upper case file names, but S-BASIC does not
|
||||
automatically convert file name arguments to upper case, so we
|
||||
have to do that ourself.
|
||||
end
|
||||
create "OUTPUT.TXT"
|
||||
open #1,"INPUT.TXT"
|
||||
open #2,"OUTPUT.TXT"
|
||||
|
||||
comment
|
||||
S-BASIC allows alphanumeric line "numbers" (which are treated simply
|
||||
as labels) as the target of GOTO and GOSUB statements, but the first
|
||||
character must be a digit
|
||||
end
|
||||
on error goto 9done
|
||||
|
||||
rem - runtime error code 15 signals read past end of file
|
||||
while errcode <> 15 do
|
||||
begin
|
||||
input3 #1; s
|
||||
print #2; s
|
||||
end
|
||||
|
||||
9done
|
||||
close #1
|
||||
close #2
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue