×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

doubt in clrscr

doubt in clrscr

doubt in clrscr

(OP)
Hai friends,
Iam using Turbo Pascal 7.0.

In this simple program:

program test(input,output);
begin
 clrscr;
 writeln;
 Writeln('Hello');
 Readln;
end.

Here, in this program in line 3 (ie) clrscr;

Its giving an error saying unknown identifier.

I want to clear the screen and show the output.

Kindly advice me as regards this.

Regards
Uma.

RE: doubt in clrscr

clrscr is declared in the crt unit.

try this:

program test(input,output);
uses crt; { <- add this line }
begin
 clrscr;
 writeln;
 Writeln('Hello');
 Readln;
end.

RE: doubt in clrscr

(OP)
Hai,
Thanx for ur reply. But I have added uses Crt in the program

(ie)
program test(input,output);
uses Crt;
 begin
 clrscr;
 writeln;
 Writeln('Hello');
 Readln;
 end.


But its giving a runtime error as Division by zero for this. Plz help me as Iam desperate.

RE: doubt in clrscr

Yes, this is a well known fault in turbo pascal. The reason is that you are using a fast computer. One of the functions of the crt unit is to do some timing, and for this it begins by establishing the speed of your computer by counting up from zero while it times something. If the machine is very fast, the count never gets beyond zero, and crt causes a division-by-zero error before the program even starts to run.

But all is not lost! Because this is well known, there are already a lot of replacement crt units and patches written by friendly lovers of Pascal. Do some web-searching and you'll find one.

I've never bothered because I only use crt for keypress functions, so when i found out about that error I just wrote my own call-to-dos for keypresses, and haven't used crt since.

Hope this helps,

Lionel

(Oh, and compliments to Borland, it's a very rare thing to find a bug in their compilers)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close