TIP: Click on subject to list as thread! ANSI
echo: z3_pascal
to: Bob Lawrence
from: David Drummond
date: 1996-04-27 14:04:48
subject: StringToInteger

Bob, at 08:42 on Apr 26 1996, you wrote to All ...

BL> I need a really fast String-to-Integer converter. This is
BL> what I'm using and I can't think of anything smaller or 
BL> faster, but it would be nice if it was twice as fast. My 
BL> string is just a number with junk I don't care about 
BL> following it.


BL> function StrInt(s: string): integer;
BL> var
BL> i, size: integer;
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;

Check out VAL()

David
@EOT:

--- Msgedsq/2 3.10
* Origin: JabberWOCky CBCS +61 7 3868 1597 (3:640/305)
SEEN-BY: 633/267 270
@PATH: 640/305 820 711/409 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™.