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!

Categories

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.

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]