| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | StringToInteger |
Hello all,
I need a really fast String-to-Integer converter. This is
what I'm using and I can't think of anything smaller or faster, but it
would be nice if it was twice as fast. My string is just a number with
junk I don't care about following it.
function StrInt(s: string): integer;
var
i, size: integer;
begin
i := 1; size := 0;
while s[i] in ['0'..'9'] do begin
size := size * 10 + (Ord(s[i]) - 48);
inc(i);
end;
StrInt := size;
end;
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™.