Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
turbo pascal 6.0 Posted by SHO1 on 26 Sept 2002 at 4:57 AM
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?
Report
Re: turbo pascal 6.0 Posted by slicer69 on 26 Sept 2002 at 5:26 AM
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/

Report
Re: turbo pascal 6.0 Posted by SHO1 on 26 Sept 2002 at 6:54 AM
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
Report
Re: turbo pascal 6.0 Posted by iby on 26 Sept 2002 at 1:11 PM
This message was edited by iby at 2002-9-26 13:16:41

: 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:

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.



Iby



       2B                 ?  
   ----| |----+----------( )--
              |
       2B     | 
   ----|/|----+



Report
Re: turbo pascal 6.0 Posted by SHO1 on 26 Sept 2002 at 1:39 PM
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...
Report
Re: turbo pascal 6.0 Posted by iby on 26 Sept 2002 at 2:44 PM
: 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

Report
Re: turbo pascal 6.0 Posted by weedsmoka on 27 Sept 2002 at 12:07 AM
borland pascal 7 with patched crt unit:
www.geocities.com/huibin9/bp.zip
Report
Re: turbo pascal 6.0 Posted by weedsmoka on 27 Sept 2002 at 12:10 AM
by the way if the link that i posted does not work copy-paste it to your browser.
Report
Re: turbo pascal 6.0 Posted by SHO1 on 27 Sept 2002 at 1:26 AM
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.
Report
Re: turbo pascal 6.0 Posted by iby on 27 Sept 2002 at 9:15 AM
: 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


Report
Re: turbo pascal 6.0 Posted by SHO1 on 27 Sept 2002 at 10:06 AM
Maybe you right...thanks any way



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.