Align columns: Difference between revisions
m
→{{header|Amazing Hopper}}
Line 1,269:
Declare as Numeric ( fd, i, index, max token )
as Numeric ( num tokens, size Column, tCells
as Alpha ( line )
as Numeric ( display Left, display Right, display Center )
GetParam(script, file to edit, separator)
Line 1,289 ⟶ 1,288:
When( File Error ){ Stop }
index=1
While Not Eof(fd)
Set Interval [index, 1:num tokens]; Take( line ) and SPut(cells)
When ( var( max token) Is Lt (num tokens) ) { max token = num tokens }
Line 1,297 ⟶ 1,296:
Wend
Close(fd)
// formatting...
For Up( i:=1, max token, 1 )
Set Interval [1:end,i], and Let (
LPad$( " ", size Column, tCells ), and Put(display Left)
RPad$( " ", size Column, tCells ), and Put(display Right)
CPad$( " ", size Column, tCells ), and Put(display Center)
Next
// display:
Token Sep ("")
|