Board index » delphi » TP - Error 200

TP - Error 200

We have just started Pascal programming lessons at college & am having trouble running this program at home. I am using the same
version of TP7 at home/college. I keep getting Error 200 when I try and run it (Division By Zero).

My code is below, its just a simple adding program - can anyone get this to run please?

Thanks,
Gemma

-----

program adder;
{ Author: Gemz
  Description: My Adding Program
  Date:  January/February 2001 }

uses crt;

var user_name : string[20];
    num1      : integer;
    num2      : integer;
    answer    : integer;
    go_on     : char;

procedure B1_COLS;
begin
  textbackground(black);
end;

procedure B2_USER;
begin
  clrscr;
  textcolor(red);
  gotoxy(19,3);
  writeln('Gemziz Adder Program');
  gotoxy(19,6);
  write('User name - [                    ]');
  gotoxy(19,8);
  write('Number 1  - [     ]');
  gotoxy(19,10);
  write('Number 2  - [     ]');
  gotoxy(19,12);
  write('Answer    - [     ]');
  textcolor(yellow);
  gotoxy(32,6);
  readln(user_name);
  go_on:='y'
end;

procedure B3_DATA;
begin
  gotoxy(32,8);
  writeln('    ');
  gotoxy(32,10);
  writeln('    ');
  gotoxy(32,12);
  writeln('    ');
  gotoxy(32,8);
  readln(num1);
  gotoxy(32,10);
  readln(num2);
end;

procedure B4_CD;
begin
  answer:=num1+num2;
  gotoxy(32,12);
  writeln(answer);
  gotoxy(14,15);
  writeln('Would you like to use this program again (y/n)? ');
  go_on:=readkey;
  gotoxy(14,15);
  writeln('                                                ');
end;

procedure A1_INIT;
begin
  B1_COLS;
  B2_USER;
end;

procedure A2_MAIN;
begin
  B3_DATA;
  B4_CD;
end;

procedure A3_CLOSE;
begin
  textcolor(white);
  gotoxy(14,15);
  writeln('Hope you found this useful, ', user_name, '. (Press enter)');
  readln;
end;

begin
  A1_INIT;
  while(go_on='y') do A2_MAIN;
  A3_CLOSE;
end.

 

Re:TP - Error 200


Quote
* Gemz * wrote:

> We have just started Pascal programming lessons at college & am having trouble running this program at home. I am using the same
> version of TP7 at home/college. I keep getting Error 200 when I try and run it (Division By Zero).

> My code is below, its just a simple adding program - can anyone get this to run please?

You will get lots of angry answers here... ;-))

The problem is: the CRT.TPU unit of TP 7 has an ERROR. It
produces the 200-error on fast machines. This is a extremely FAQ.

http://bsn.ch/tp-links  chapter "patches" has links to lots of
solutions. It is also suggested that you read the last 2 weeks
of postins here and in the c.l.p.b. group.

Greetings.
--
Franz Glaser, Glasau 3, A-4191 Vorderweissenbach Austria +43-7219-7035-0
Muehlviertler Elektronik Glaser.  Industrial control and instrumentation
http://members.eunet.at/meg-glaser/    http://members.xoom.com/f_glaser/
http://www.geocities.com/~franzglaser/            http://start.at/bedarf

Other Threads