home *** CD-ROM | disk | FTP | other *** search
- Program RandText;
-
-
- Uses Crt;
-
- Var
- Outfile : text;
- TotLines, I, J, Line_Width : Integer;
- CaseTog : Integer;
- Lin, Nst, Fna : String;
- Tch : Char;
-
- Begin
- Write('Number of text lines to make --> ');
- readln(TotLines);
- Write('Width of each text line (>1 and <255) --> ');
- Readln(Line_Width);
- Write('Name of output file --> ');
- readln(Fna);
- WriteLn;
- WriteLn('Creating and writing ',Fna);
- Assign(Outfile,Fna);
- Rewrite(Outfile);
- Str(TotLines,Nst);
- WriteLn(Outfile,Nst);
- For I := 1 to TotLines do
- begin
- Lin := '';
- For J := 1 to Line_Width do
- begin
- CaseTog := Random(2);
- Tch := Chr(Random(26) + ((1-CaseTog)*65) + (CaseTog*97) );
- Lin := Lin + Tch;
- end;
- Writeln(Outfile,Lin);
- Write(I,' lines written',chr(13));
- end;
- Close(Outfile);
- End.
-