Unclear compile error... 
Author Message
 Unclear compile error...

I'm trying to compile this, only thing it should do is take the value of
pressure and turn a letter to a unit(like p for Pa(scal)). But only thing
i get out is short compile error;

pg1.p: In main program:
pg1.p:21: parse error before `.
-------------------------------------------
program trycket(input,output);

VAR
   tryck : Real;
   sort  : char;
BEGIN
   CASE sort of
     'a' : writeln('atm');
     'm' : writeln('mbar');
     'p' : writeln('Pa');
     't' : writeln('torr')
   END;

BEGIN
   Writeln('Ge varde for trycket: '); Readln(tryck);
   Writeln(tryck);
   Writeln('Ge bokstav till enhet,( a m p eller t) : ');
   Readln(sort);
   Writeln('Trycket blir ',  tryck:1:1, sort);
      END.
 -----------------------------------------------------------  
Can somebody give me a hint...

reg,
jk



Mon, 11 Apr 2005 03:54:04 GMT  
 Unclear compile error...



Quote:
> I'm trying to compile this, only thing it should do is take the value
of
> pressure and turn a letter to a unit(like p for Pa(scal)). But only
thing
> i get out is short compile error;

> pg1.p: In main program:
> pg1.p:21: parse error before `.
> -------------------------------------------
> program trycket(input,output);

> VAR
>    tryck : Real;
>    sort : char;
> BEGIN     <<< Did you really mean to start your main program here?
>    CASE sort of   <<<< This does not work, since it is the first

statement in your program the parameter "sort" has no value yet.

Quote:
>      'a' : writeln('atm');
>      'm' : writeln('mbar');
>      'p' : writeln('Pa');
>      't' : writeln('torr')
>    END;

> BEGIN    <<<<< What this? Another begin of your main program?????
>    Writeln('Ge varde for trycket: '); Readln(tryck);
>    Writeln(tryck);
>    Writeln('Ge bokstav till enhet,( a m p eller t) : ');
>    Readln(sort);
>    Writeln('Trycket blir ',  tryck:1:1, sort);

So how did you think to replace the sort char with the replacement text?

- Show quoted text -

Quote:
>       END.
>  -----------------------------------------------------------
> Can somebody give me a hint...

> reg,
> jk



Mon, 11 Apr 2005 06:02:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. compile error - help please

2. compile error - help!

3. Interbase config - can't compile (password error)

4. -lvga error from svgalib demos compile

5. error msg when compiling program

6. Version 5 compile error

7. run time error when compiled

8. compiling error : HELP !

9. Runtime error when running compiled program only

10. Delphi 4 compiling error

11. pascal program hangs although no compiling errors

12. Compile error, Help!

 

 
Powered by phpBB® Forum Software