#include <oxstd.h>
main()
{
    decl file;

    file = fopen("iotest2.txt", "w");
    fprint(file, "tinker123\ntailor456.78\n 2 2 1 0 0 1\n");
    fclose(file);

    decl c = -2, s, i = 0, d = 0, m = 0;

    file = fopen("iotest2.txt");
    println("Next statement will print message: "
          "\"load matrix: no matrix elements\"");

    c = fscan(file, "%s", &s,       // stops after &s
        "%d", &i, "%f", &d, "%m", &m);
    fclose(file);

    print("\nitems read=", c, " s=", s, " int=", i,
        " dbl=", d, " mat=", m);

    file = fopen("iotest2.txt");
    c = fscan(file, "tinker%d", &i, " tailor%f", &d, "%m", &m);
    fclose(file);

    print("\nitems read=", c, " int=", i, " dbl=", d,
        " mat=", m);
}
