Discussion:
what's wrong with my code?
(too old to reply)
Jack
2004-12-01 02:31:30 UTC
Permalink
Hi
When I try to compile this, it says "7 / 11 3.pas
Fatal: Syntax error, : expected but identifier RADIUS found"
Any help is appreciated.

{example}
PROGRAM Functions1(OUTPUT);
{Constant Declarations}
CONST
Pi=3.14159;
VAR
Perimeter Radius :REAL;
RoundedPerimeter, TruncatedPerimeter :INTEGER;
{PROGRAM BLOCK}
BEGIN
Radius := 4.9;
Perimeter := 2*Pi*Radius
RoundedPerimeter := ROUND(Perimeter);
TruncatedPerimeter := TRUNCH(Perimeter);
WRITELN('Perimeter of the circle is', Perimeter);
WRITELN('Perimeter (rounded) is', RoundedPerimeter);
WRITELN('Perimeter (TRUNCATED) is', TruncatedPerimeter);
END.


thx
Norm Mann
2004-12-01 00:33:15 UTC
Permalink
Post by Jack
Hi
When I try to compile this, it says "7 / 11 3.pas
Fatal: Syntax error, : expected but identifier RADIUS found"
Any help is appreciated.
{example}
PROGRAM Functions1(OUTPUT);
{Constant Declarations}
CONST
Pi=3.14159;
VAR
Perimeter Radius :REAL;
perhaps this should be:

Perimeter, Radius : REAL;

Note: comma added.
Jack
2004-12-02 03:46:41 UTC
Permalink
Thank you Norm! I got it working! I didn't know people are actually
looking at this newsgroup, lol.

Loading...