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.

turbo pascal 6.0

SHO1SHO1 Posts: 8Member
Two questions:
First does anybody know why every time that I'm use users crt it's writting to me "Division by zero" and how to fix it?
Second how can I make a[1]=3 a[2]=1 a[3]=2 a[4]=1 a[5]=8 to
b[1]=1 b[2]=2 b[3]=3 b[4]=8 b[5]=0?

Comments

  • slicer69slicer69 Posts: 272Member
    Usually, processors running at over 200MHz cause the CRT
    unit to crash. To fix this, you can download my replacement
    for the CRT unit at http://slicer69.tripod.com/code/

  • SHO1SHO1 Posts: 8Member
    Your unit has destroyed my pascal:
    I wrote to it Clrscr and i've got an error and now every time when Im open the pascal I can't see a thing... Please help.
    P.S.
    sorry about my english
  • ibyiby Posts: 323Member
    [b][red]This message was edited by iby at 2002-9-26 13:16:41[/red][/b][hr]
    : Your unit has destroyed my pascal:
    : I wrote to it Clrscr and i've got an error and now every time when Im open the pascal I can't see a thing... Please help.
    : P.S.
    : sorry about my english
    :


    Well, first of all, only TP7 has faulty CRT unit,
    if I'm not mistaken. You mentioned that you have TP6.
    If so and you have copied CRT.TPU to your pascal
    directory, simply remove it.
    If the CRT.TPU is part of the TURBO.TPL, replace this
    file with original (the one that comes with your pascal version).

    Now back to your array question. It looks to me that
    you want to sort array A[] and place it into B[].
    Try any sorting algorythm you can find.
    As always the simplest one is not the fastest.
    There are always compromises. I hope you will
    find following code simple enough:

    [code]
    program sort_test;

    var ArrayA,ArrayB:array[1..10] of integer;
    i,j,temp:integer;

    begin

    { Get some numbers from user }

    for i:=1 to 10 do
    begin
    write('Enter integer nr.',i,': ');
    readln(ArrayA[i]);
    end;


    { Copy values to ArrayB }

    ArrayB:=ArrayA;

    { Sort the values of ArrayB. This is not quite straight
    forward, but here is an explanation:

    Assume first array element is the smallest. Often, this is
    not true but we have to start somewhere and there are
    worse choices than starting from begining...
    Now, search through array and see if we find element that
    is even smaller and replace it with the one we tought it
    was the smallest.
    This way size of array doesn't change, only thing that
    happened was that smallest element got to first place,
    and one that was there before is moved back to it's place.
    So very first element is ok. To sort the rest of the array
    you have to keep repeating the process untill end of the array
    is reached. }

    { note: index "i" points to what we think is the smallest element.
    index "j" points to other elements we are screening }

    for i:=1 to 9 do
    for j:=i+1 to 10 do

    { check if found element is smaller }

    if ArrayB[j]<ArrayB[i] then

    { if smaller, swap the elements }

    begin
    temp:=ArrayB[j];
    ArrayB[j]:=ArrayB[i];
    ArrayB[i]:=temp;
    end;


    { print both arrays for comparison }

    writeln('A B');
    writeln('----------------');

    for i:=1 to 10 do
    writeln(ArrayA[i],' ',ArrayB[i]);

    writeln('Check if Array B is sorted. Press Enter to exit...');
    readln;
    end.
    [/code]


    Iby



    [code]
    2B ?
    ----| |----+----------( )--
    |
    2B |
    ----|/|----+
    [/code]


  • SHO1SHO1 Posts: 8Member
    I've deleted my crt unit and every thing you said but it's not helping: even after I have deleted all my pascal folder and install pascal 7.0 I can't see any thing when I'm opening pascal...............
    ...Help...
  • ibyiby Posts: 323Member
    : I've deleted my crt unit and every thing you said but it's not helping: even after I have deleted all my pascal folder and install pascal 7.0 I can't see any thing when I'm opening pascal...............
    : ...Help...
    :


    Are you sure you are not blindfolded? :-)
    What do you mean you don't see anything?
    How are you opening it? Are you sure you
    are not clicking on old icons while your
    new TP installation is in different folder?
    Search your harddrive for TURBO.EXE and run it.

    Iby

  • weedsmokaweedsmoka Posts: 34Member
    borland pascal 7 with patched crt unit:
    www.geocities.com/huibin9/bp.zip
  • weedsmokaweedsmoka Posts: 34Member
    by the way if the link that i posted does not work copy-paste it to your browser.
  • SHO1SHO1 Posts: 8Member
    I'm not that stupid... every time when I'm opening turbo.exe I can write but I realy can't understand what I'm writing...and not any tpu can help it i think that have to format my computer.
  • ibyiby Posts: 323Member
    : I'm not that stupid... every time when I'm opening turbo.exe I can write but I realy can't understand what I'm writing...and not any tpu can help it i think that have to format my computer.
    :


    Formating PC harddrive is *always* good start.
    And if it doesn't fix your problem, at least
    you will be richer for the experience :-)
    It looks to me that you need a book on
    pascal programming and start from beginning...

    Iby


  • SHO1SHO1 Posts: 8Member
    Maybe you right...thanks any way
Sign In or Register to comment.