I got a double error 200 : Division by zero! Help please. - Programmers Heaven

#### Howdy, Stranger!

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

# I got a double error 200 : Division by zero! Help please.

Posts: 2Member
Hi! I got this code from one of my friend, and he asked me to translate it into another language. Problem is, when i test run them (with the TP7.0 fixed to avoid error 200) , I got another, exactly same error when the program attempt to draw something. (I tripple check the code, both the variables in the calculation are not 0). Is there anyway to fix it please ?

[code]
PROGRAM SS12(INPUT,OUTPUT);
uses crt,graph;
LABEL 1,2;
{declare variables}
BEGIN
ClrScr;
assign(fv,'c:usertbTG2.TG');{\$I-} Reset(fv) {\$I+};
FOR JTD:=1 TO NTD do BEGIN
for i:=1 to 26 do BEGIN
END;
chuan:=800;chuan1:=400;
2: FOR JTD:=1 TO ntd DO BEGIN
r:= rr[jtd];
FOR I:=1 TO 26 DO BEGIN
G:=XG[JTD,I]/R; {error is here , division by 200}
XG1[JTD,I]:=R*COS(G);
YG1[JTD,I]:=-R*SIN(G);
g:=g-pi/5;
xg2[jtd,i]:=r*cos(g);yg12[jtd,i]:=-r*sin(g);END;
END.
[/code]

• Posts: 35Member
It would help if you posted the complete program. You have a comment "{declare variables}" which I assume means that your original code declares variables, but what you've posted does not. What you've posted does not compile.

You seem to have a "begin" without a corresponding "end." There are 5
"begin"s and only 4 "end"s.