Previous topic | Next topic | Ada Home Page | Index

TEXT_IO

To work with text files, an Ada program must import the TEXT_IO package.

TEXT_IO provides:

Page - line - character

Procedures to create the page/line/character structure:

Procedures to recognise the page/line/character structure:

Functions to recognise position within the page/line/character structure:

Example:

        SET_LINE (2);
        SET_COL (30); PUT ("Student Results Report");

        SET_LINE (4);
        SET_COL ( 5); PUT ("Student name");
        SET_COL (35); PUT ("Assignments");
        SET_COL (50); PUT ("Exams");
        SET_COL (65); PUT ("Average");

        SET_LINE (6);

Line Length

For output files, you can define automatic line and page lengths

SET_LINE_LENGTH:

Example:

    SET_LINE_LENGTH (30);
    for i in 1 .. 20 loop
        PUT (i**2, width => 5);
    end loop;



    '    1    4    9   16   25   36'
    '   49   64   81  100  121  144'
    '  169  196  225  256  289  324'
    '  361  400'

SET_PAGE_LENGTH is analogous


Previous topic | Next topic | Ada Home Page | Index
c-lokan@adfa.oz.au / 22 Feb 96