September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,14 @@
10 rem load the entire contents of some text file as a single string variable.
20 rem should avoid reading an entire file at once if the file is large
30 rem ================================
40 print chr$(14) : rem switch to upper+lowercase character set
50 open 4,8,4,"data.txt,seq,read"
60 n=0
70 for i=0 to 1
80 get#4,x$
90 i=st and 64 : rem check for 'end-of-file'
100 if i=0 then a$=a$+x$ : n=n+1
110 if n=255 then i=1 : rem max string length is 255 only
120 next
130 close 4
140 end

View file

@ -0,0 +1 @@
content$ = LOAD$(filename$)

View file

@ -0,0 +1,3 @@
binary = BLOAD("somefile.bin")
PRINT "First two bytes are: ", PEEK(binary), " ", PEEK(binary+1)
FREE binary

View file

@ -0,0 +1,6 @@
Public Sub Form_Open()
Dim sFile As String
sFile = File.Load(User.home &/ "file.txt")
End

View file

@ -1,3 +1,5 @@
fun readText() {
val string = File("unixdict.txt").readText(charset = Charsets.UTF_8)
import java.io.File
fun main(args: Array<String>) {
println(File("unixdict.txt").readText(charset = Charsets.UTF_8))
}

View file

@ -1 +0,0 @@
readFile(filename)

View file

@ -0,0 +1,3 @@
file = 'c:\test.txt'
myStream = .stream~new(file)
myString = myStream~charIn(,myStream~chars)

View file

@ -0,0 +1,7 @@
file = 'c:\test.txt'
myStream = .stream~new(file)
if mystream~open('read') = 'READY:'
then do
myString = myStream~charIn(,myStream~chars)
myStream~close
end

View file

@ -0,0 +1,9 @@
address hostemu 'execio * diskr "./st.in" (finis stem in.'
Say in.0 'lines in file st.in'
v=''
Do i=1 To in.0
Say i '>'in.i'<'
v=v||in.i
End
say 'v='v
::requires "hostemu" LIBRARY

View file

@ -0,0 +1 @@
text = #.readtext("filename.txt")

View file

@ -0,0 +1,8 @@
mata
f = fopen("somedata.txt", "r")
fseek(f, 0, 1)
n = ftell(f)
fseek(f, 0, -1)
s = fread(f, n)
fclose(f)
end

View file

@ -0,0 +1 @@
data := File("foo.txt","r").read()