Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

doubt in clrscr

uma2001uma2001 Posts: 5Member
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.

Comments

  • zibadianzibadian Posts: 6,349Member
    : 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.
    :
    If you look at the help file page on the clrscr procedure, you will see that it is located in the Crt or WinCrt unit. Your program needs to use this unit to compile correctly.
    Hint: An unknown identifier always happens because of one of three reasons. Here they are with their solutions:
    - The unit which holds the identifier is not in the uses list. Solution: add the unit to the uses list.
    - A typing error was made in the identifier. Solution: correct the error.
    - The identifier is truly unknown. Solution: declare the identifier before the line in which it is used.
  • uma2001uma2001 Posts: 5Member
    : : 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.
    : :
    : If you look at the help file page on the clrscr procedure, you will see that it is located in the Crt or WinCrt unit. Your program needs to use this unit to compile correctly.
    : Hint: An unknown identifier always happens because of one of three reasons. Here they are with their solutions:
    : - The unit which holds the identifier is not in the uses list. Solution: add the unit to the uses list.
    : - A typing error was made in the identifier. Solution: correct the error.
    : - The identifier is truly unknown. Solution: declare the identifier before the line in which it is used.
    :






    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.



  • zibadianzibadian Posts: 6,349Member
    : : : 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.
    : : :
    : : If you look at the help file page on the clrscr procedure, you will see that it is located in the Crt or WinCrt unit. Your program needs to use this unit to compile correctly.
    : : Hint: An unknown identifier always happens because of one of three reasons. Here they are with their solutions:
    : : - The unit which holds the identifier is not in the uses list. Solution: add the unit to the uses list.
    : : - A typing error was made in the identifier. Solution: correct the error.
    : : - The identifier is truly unknown. Solution: declare the identifier before the line in which it is used.
    : :
    :
    :
    :
    :
    :
    :
    : 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.
    :
    :
    :
    :
    Under several newer windows versions the crt gives that error. There are several patches on the internet. You can find them using google with "turbo pascal crt patch" search string.
    If you don't want to patch your crt, you can always writeln() 25 empty lines onto your screen.
  • uma2001uma2001 Posts: 5Member
    : : : : 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.
    : : : :
    : : : If you look at the help file page on the clrscr procedure, you will see that it is located in the Crt or WinCrt unit. Your program needs to use this unit to compile correctly.
    : : : Hint: An unknown identifier always happens because of one of three reasons. Here they are with their solutions:
    : : : - The unit which holds the identifier is not in the uses list. Solution: add the unit to the uses list.
    : : : - A typing error was made in the identifier. Solution: correct the error.
    : : : - The identifier is truly unknown. Solution: declare the identifier before the line in which it is used.
    : : :
    : :
    : :
    : :
    : :
    : :
    : :
    : : 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.
    : :
    : :
    : :
    : :
    : Under several newer windows versions the crt gives that error. There are several patches on the internet. You can find them using google with "turbo pascal crt patch" search string.
    : If you don't want to patch your crt, you can always writeln() 25 empty lines onto your screen.
    :




    Hai
    thanx for ur reply yaa. But its giving some error message if i give
    writeln() 25
    Can u tell me the exact syntax for this plz
    thanx


  • zibadianzibadian Posts: 6,349Member
    : : : : : 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.
    : : : : :
    : : : : If you look at the help file page on the clrscr procedure, you will see that it is located in the Crt or WinCrt unit. Your program needs to use this unit to compile correctly.
    : : : : Hint: An unknown identifier always happens because of one of three reasons. Here they are with their solutions:
    : : : : - The unit which holds the identifier is not in the uses list. Solution: add the unit to the uses list.
    : : : : - A typing error was made in the identifier. Solution: correct the error.
    : : : : - The identifier is truly unknown. Solution: declare the identifier before the line in which it is used.
    : : : :
    : : :
    : : :
    : : :
    : : :
    : : :
    : : :
    : : : 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.
    : : :
    : : :
    : : :
    : : :
    : : Under several newer windows versions the crt gives that error. There are several patches on the internet. You can find them using google with "turbo pascal crt patch" search string.
    : : If you don't want to patch your crt, you can always writeln() 25 empty lines onto your screen.
    : :
    :
    :
    :
    :
    : Hai
    : thanx for ur reply yaa. But its giving some error message if i give
    : writeln() 25
    : Can u tell me the exact syntax for this plz
    : thanx
    :
    :
    :
    [code]
    for i := 1 to 25 do
    writeln;
    [/code]
  • ManningManning Posts: 1,621Member
    : : : : : 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.
    : : : : :
    : : : : If you look at the help file page on the clrscr procedure, you will see that it is located in the Crt or WinCrt unit. Your program needs to use this unit to compile correctly.
    : : : : Hint: An unknown identifier always happens because of one of three reasons. Here they are with their solutions:
    : : : : - The unit which holds the identifier is not in the uses list. Solution: add the unit to the uses list.
    : : : : - A typing error was made in the identifier. Solution: correct the error.
    : : : : - The identifier is truly unknown. Solution: declare the identifier before the line in which it is used.
    : : : :
    : : :
    : : :
    : : :
    : : :
    : : :
    : : :
    : : : 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.
    : : :
    : : :
    : : :
    : : :
    : : Under several newer windows versions the crt gives that error. There are several patches on the internet. You can find them using google with "turbo pascal crt patch" search string.
    : : If you don't want to patch your crt, you can always writeln() 25 empty lines onto your screen.
    : :
    :
    :
    :
    :
    : Hai
    : thanx for ur reply yaa. But its giving some error message if i give
    : writeln() 25
    : Can u tell me the exact syntax for this plz
    : thanx


    If you include the CRT unit in your uses statement it will give you the divide by 0 error even if you dont call any of the functions it contains. The problem is in the initialization. So for instance:

    [code]
    program test;

    uses crt;

    var i: integer
    begin
    for i := 1 to 25 do
    writeln;
    end.
    [/code]

    That code will still give you the runtime error. You didnt call ClrScr() or any other function from the Crt unit, but it'll happen anyway.

    The best solution is to search for the patch as zibadian suggested. There may come a time when you cant use a workaround like using WriteLn 25 times, so you'll need it then anyway.
  • ibyiby Posts: 323Member
    you can as well try to set the mode again.
    as side effect the screen will be cleared.

    [code]
    function set_text_mode;assembler;
    asm
    mov ax,3
    int 16
    end;
    [/code]

    the downside is, it is not all that fast plus
    if you are running in a dos-box, it will maximize
    window.


Sign In or Register to comment.