TIP: Click on subject to list as thread! ANSI
echo: z3_pascal
to: David Drummond
from: Bob Lawrence
date: 1996-05-03 07:46:14
subject: StringToInteger

BL>> begin
 BL>>    i := 1; size := 0;
 BL>>    while s[i] in ['0'..'9'] do begin
 BL>>       size := size * 10 + (Ord(s[i]) - 48);
 BL>>       inc(i);
 BL>>    end;
 BL>>    StrInt := size;
 BL>> end;

 DD>> Check out VAL()

 DD> What are you timing it with?

  I just run StrToInt 100,000 times and time it with the profiler.

 BL> If I go val('223 Sheep Street',n , i); I get zero and a fault
 BL> at 4. Val can't handle the Sheep.

 DD> You want me to?

  Val is a silly name for a procedure. They ought to call it Shirley.

Regards,
Bob
___ Blue Wave/QWK v2.12
@EOT:

---
* Origin: Precision Nonsense, Sydney (3:711/934.12)
SEEN-BY: 633/267 270
@PATH: 711/934 809 808 50/99 635/544 727 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.