12-28-2005, 01:40 PM
It has been kindly pointed out to me that Liberty Basic does have an alternative to the PROCedures used in BBC BASIC (for Windows) needed for true Structured Programming as below. I wonder how the experts on programming view the LB way
Gordon
'copy two files into one
fileOne$ = "first.txt"
fileTwo$ = "second.txt"
combined$ = "together.txt"
call mergeFiles fileOne$, fileTwo$, combined$
end
sub mergeFiles firstFile$, secondFile$, merged$
open merged$ for output as #merged
open firstFile$ for input as #first
print #merged, input$(#first, lof(#first));
close #first
open secondFile$ for input as #second
print #merged, input$(#second, lof(#second));
close #second
close #merged
end sub
Gordon
'copy two files into one
fileOne$ = "first.txt"
fileTwo$ = "second.txt"
combined$ = "together.txt"
call mergeFiles fileOne$, fileTwo$, combined$
end
sub mergeFiles firstFile$, secondFile$, merged$
open merged$ for output as #merged
open firstFile$ for input as #first
print #merged, input$(#first, lof(#first));
close #first
open secondFile$ for input as #second
print #merged, input$(#second, lof(#second));
close #second
close #merged
end sub