| 12345678910111213141516171819202122 |
- program t103_valreal;
- { t103 -- Val on a REAL destination. The counted source is copied to an
- ASCIIZ buffer by val_real, then parsed by the same ascreal core. }
- var
- S : string[20];
- R : real;
- E : integer;
- begin
- S := '1.5';
- Val (S, R, E);
- Str (R : 0 : 1, S);
- writeln (S, ' ', E);
- S := '-2.25';
- Val (S, R, E);
- Str (R : 0 : 2, S);
- writeln (S, ' ', E);
- S := '3.5x';
- Val (S, R, E);
- writeln (E)
- end.
|