perm filename MAKEDF.SIM[SIM,SYS] blob sn#460131 filedate 1979-07-20 generic text, type T, neo UTF8
OPTIONS(/C/-Q/-A/-I/-D);
BEGIN TEXT inname,outname;
    EXTERNAL INTEGER PROCEDURE scanint;
    REF (Directfile) df;
    INTEGER iz,p;
    TEXT buf;
    Outtext("Input file:"); Breakoutimage;
    Lastitem; inname:- Intext(Sysin.Length-Sysin.Pos+1).Strip;
    retry:
    Outtext("Imagesize:");   Breakoutimage;
    IF Lastitem THEN GO TO fin;
    p:= Sysin.Pos;   iz:= scanint(Sysin.Image);
    IF Sysin.Pos = p THEN
    BEGIN   Outtext("? Enter proper integer item.");   Outimage;
	Sysin.Setpos(0);   GO TO retry
    END;
    Sysin.Setpos(0);
    INSPECT NEW Infile(inname) DO
    BEGIN Open(Blanks(iz));
	Outtext("Output(DA):");  Breakoutimage;
	Sysin.Lastitem;
	outname:- Sysin.Intext(Sysin.Length-Sysin.Pos+1).Strip;
	INSPECT NEW Directfile(outname) DO
	BEGIN   Open(THIS Infile.Image);
	    THIS Infile.Inimage;
	    WHILE NOT THIS Infile.Endfile DO
	    BEGIN   Outimage;   THIS Infile.Inimage   END;
	    Close;
	END df;
	Close;
    END inf;
    fin:
END of program