Reverse the order of lines in a text file while preserving the contents of each line: Difference between revisions
Content added Content deleted
(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: | Line 117: | ||
"Diplomacy is the art of |
"Diplomacy is the art of |
||
</pre> |
</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}}== |
=={{header|Factor}}== |