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.