2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,7 +1,12 @@
{{selection|Short Circuit|Console Program Basics}}[[Category:Basic language learning]] [[Category:Streams]] [[Category:Simple]]
{{selection|Short Circuit|Console Program Basics}}
[[Category:Basic language learning]]
[[Category:Streams]]
[[Category:Simple]]
{{omit from|PARI/GP|No access to streams other than input}}
{{omit from|TI-89 BASIC}} <!-- No streams other than user input, not really applicable. -->
Read from a text stream either word-by-word or line-by-line
until the stream runs out of data. <br>
;Task:
Read from a text stream either word-by-word or line-by-line until the stream runs out of data.
The stream will have an unknown amount of data on it.
<br><br>

View file

@ -0,0 +1,9 @@
#import system.
#import system'routines.
#import system'io.
#import extensions'routines.
#symbol program =
[
ReaderEnumerator new:("file.txt" file_path textreader) run &each:printingLn.
].

View file

@ -0,0 +1,11 @@
#import system.
#import system'io.
#symbol program =
[
#var reader := "file.txt" file_path textreader.
#loop (reader available)?
[
console writeLine:(reader read &literal).
].
].

View file

@ -1,3 +1,3 @@
for pipe("find -iname '*.txt'").lines -> $filename {
for run(«find -iname *.txt», :out).out.lines -> $filename {
...
}

View file

@ -1,3 +1,3 @@
for pipe("find -iname '*.txt' -print0", :nl«\0»).lines -> $filename {
for run(«find -iname *.txt -print0», :nl«\0», :out).out.lines -> $filename {
...
}

View file

@ -0,0 +1,12 @@
filepath = "SPECIFY PATH TO TEXT FILE HERE"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objInFile = objFSO.OpenTextFile(filepath,1,False,0)
Do Until objInFile.AtEndOfStream
line = objInFile.ReadLine
WScript.StdOut.WriteLine line
Loop
objInFile.Close
Set objFSO = Nothing