Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,14 @@
' FB 1.05.0 Win64
Dim line_ As String ' line is a keyword
Open "input.txt" For Input As #1
While Not Eof(1)
Input #1, line_
Print line_ ' echo to the console
Wend
Close #1
Print
Print "Press any key to quit"
Sleep

View file

@ -0,0 +1,27 @@
include "ConsoleWindow"
local fn ReadTextFile
dim as CFURLRef fileRef
dim as Handle h
dim as CFStringRef cfStr : cfStr = NULL
dim as long fileLen
if ( files$( _CFURLRefOpen, "TEXT", "Select text file...", @fileRef ) )
open "i", 2, fileRef
fileLen = lof( 2, 1 )
h = fn NewHandleClear( fileLen )
if ( h )
read file 2, [h], fileLen
close #2
cfStr = fn CFStringCreateWithBytes( _kCFAllocatorDefault, #[h], fn GetHandleSize(h), _kCFStringEncodingMacRoman, _false )
fn DisposeH( h )
end if
else
// User canceled
end if
fn HIViewSetText( sConsoleHITextView, cfStr )
CFRelease( cfStr )
end fn
fn ReadTextFile

View file

@ -0,0 +1,10 @@
local(
myfile = file('//path/to/file.txt'),
textresult = array
)
#myfile -> foreachline => {
#textresult -> insert(#1)
}
#textresult -> join('<br />')

View file

@ -0,0 +1,4 @@
var i = open("input.txt")
for line in i.lines:
discard # process line
i.close()

View file

@ -0,0 +1 @@
: readFile(filename) File new(filename) apply(#println) ;

View file

@ -0,0 +1,9 @@
fp = fopen("C:\Ring\ReadMe.txt","r")
r = fgetc(fp)
while isstring(r)
r = fgetc(fp)
if r = char(10) see nl
else see r ok
end
fclose(fp)

View file

@ -0,0 +1,8 @@
var file = File(__FILE__)
file.open_r(\var fh, \var err) || die "#{file}: #{err}"
fh.each { |line| # iterates the lines of the fh
line.each_word { |word| # iterates the words of the line
say word
}
}

View file

@ -0,0 +1,4 @@
var line;
while (line = getline()) != nil {
print(line);
}

View file

@ -0,0 +1,5 @@
decl file f
f.open "filename.txt"
while (f.hasnext)
out (in string f) endl console
end while

View file

@ -0,0 +1 @@
jq -r -R . FILENAME

View file

@ -0,0 +1 @@
jq . FILENAME