Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.pascal.borland    |    Borland Pascal was actually pretty neat    |    2,978 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 1,634 of 2,978    |
|    =?ISO-8859-1?Q?Bj=F6rn_Felten?= to All    |
|    Re: Getting a real number from the keybo    |
|    27 May 05 21:44:43    |
   
   From: abuse@telia.com   
      
   > Have you ran your code, can you do math with the real which comes from the   
   > sting... does it work if you enter a decimal point in the string? Try it...   
      
    Yes, yes, yes and yes. In case you missed it the first time, here's   
   what I suggested:   
      
   {$N+}{$X+}   
   uses crt;   
      
   var   
    ch: char;   
    ctr: integer;   
    s: string;   
    r: extended;   
      
   BEGIN   
    while ch <> #13 do   
    BEGIN   
    inc(ctr);   
    ch := readkey;   
    write(ch);   
    s[ctr] := ch;   
    END;   
    s[0]:=char(ctr-1);   
    val(s, r, ctr);   
    writeln('r = ', r:8:8);   
   END.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca