[comp.lang.pascal] Help!! w/string to int..

kai@kaiki.toppoint.de (Kai Voelcker) (05/17/91)

in reply to:
  
>   Can some one out there tell me what is the problem????? With this code:
...
>         read(f,letter);
>         if (count=2) then begin
>           repeat
>             read(f,h); <-----------------------------what is the
>             data[i].cruise:=data[i].cruise+(h); <----PROBLEM????
>           until (letter=',');
>         count:=count+1;
>         end;
...
and some more of this repeat statements
>                                                 Thanks,
>                                                 Robert Oliver 
>                                                 robby@nuchat.sccsi.com
>

Hi,
the problem is simply that the repeat statement is an endless loop once
entered and letter wasn't ',', because nowhere in the loop letter is updated.
But even when it were, ',' is not a valid separator for integers in pascal.
See it as you will, but this is a major double semantic error. Move it to junk.
 ________________________________________________________________________
 | Kai Voelcker, Kappelner Str 18, D-2300 Kiel 1, voice: +49 431 335605 |
 | kai@kaiki.toppoint.de    interests: 386asm, c, pascal; OR algorithms |
 |   >>>  polite notice: I have to pay for incoming mail. Thanks  <<<   |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~