Jump to content

Reverse the order of lines in a text file while preserving the contents of each line: Difference between revisions

Reverse the order of lines in a text file while preserving the contents of each line en BASIC256
(Reverse the order of lines in a text file while preserving the contents of each line en FreeBASIC)
(Reverse the order of lines in a text file while preserving the contents of each line en BASIC256)
Line 117:
"Diplomacy is the art of
</pre>
 
 
=={{header|BASIC256}}==
{{trans|FreeBASIC}}
<lang BASIC256>source = freefile
open (source, "text.txt")
textEnt$ = ""
dim textSal$(size(source)*8)
linea = 0
 
while not eof(source)
textEnt$ = readline(source)
linea += 1
textSal$[linea] = textEnt$
end while
 
for n = size(source) to 1 step -1
print textSal$[n];
next n
close source
end</lang>
{{out}}
<pre>
Igual que la entrada de FreeBASIC.
</pre>
 
 
=={{header|Factor}}==
2,130

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.