RosettaCodeData/Task/Align-columns/HicEst/align-columns.hicest
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

27 lines
777 B
Text

CHARACTER Fnam = "\HicEst\Rosetta\Align columns.txt"
OPEN(FIle=Fnam, Format="12$", LENgth=rows)
! call the DLG function in MatrixExplorer mode:
DLG(Edit=Fnam, Format='12A10') ! left adjusted, 12 columns, 10 spaces each
! or the standard way:
CALL Align( "LLLLLLLLLLL ", Fnam, rows) ! left align
CALL Align( "CCCCCCCCCCC ", Fnam, rows) ! center align
CALL Align( "RRRRRRRRRRR ", Fnam, rows) ! right align
END
SUBROUTINE Align(picture, filename, rows)
CHARACTER picture, filename
CHARACTER out*400, txt*20
W = LEN(picture)
DO i = 1, rows
out = " "
DO j = 0, 100
txt = filename(i, j+1, *9) ! on error branch to label 9
WRITE(Text=out(j*W+1 : ), Format=picture) txt
ENDDO
9 CONTINUE
WRITE() out
ENDDO
END