Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
39
Task/File-input-output/FutureBasic/file-input-output.basic
Normal file
39
Task/File-input-output/FutureBasic/file-input-output.basic
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
|
||||
Rosetta Code File input/output example
|
||||
FutureBasic 7.0.14
|
||||
|
||||
Rich Love
|
||||
9/25/22
|
||||
|
||||
Before running this, use TextEdit to create a file called input.txt on your desktop.
|
||||
Format as plain text and create a few lines of text.
|
||||
Then save.
|
||||
|
||||
*/
|
||||
|
||||
output file "FileInputOutput.app"
|
||||
|
||||
CFURLRef ParentDirectory // Create a url for the desktop
|
||||
ParentDirectory = fn FileManagerURLForDirectory( NSDesktopDirectory, NSUserDomainMask )
|
||||
|
||||
CFURLRef inputURL // Create a url for input.txt on the desktop
|
||||
inputURL = fn URLByAppendingPathComponent( ParentDirectory, @"input.txt" )
|
||||
|
||||
CFURLRef outputURL // Create a url for output.txt on the desktop
|
||||
outputURL = fn URLByAppendingPathComponent( ParentDirectory, @"output.txt" )
|
||||
|
||||
open "O", 1, outputURL
|
||||
open "I", 2, inputURL
|
||||
|
||||
str255 dataLine
|
||||
|
||||
While Not Eof(2)
|
||||
Line Input #2, dataLine
|
||||
Print #1, dataLine
|
||||
Wend
|
||||
|
||||
Close #1
|
||||
Close #2
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue