xtoul

Converts a Hex string from 0x0 to 0xFFFFFFFFFFFFFF into a ulong value 0 to 18,446,744,073,709,551,615 also it handles the lowercase 'a' thru 'f'. * Authors : David 'SpottedTiger' L. Davis Created : 03.May.05 *

ulong
xtoul
(
string sx
)

Examples

1    ulong ul;
2 *
3    ul = xtoul("0"c); 
4    assert( ul == 0x0 );
5    ul = xtoul("FF"c); 
6    assert( ul == 0xFF );
7    ul = xtoul("eea"c); 
8    assert( ul == 0xEEA );
9    ul = xtoul("AB"c);
10    assert( ul == 0xAB );
11    ul = xtoul("ABCD"c);
12    assert( ul == 0xABCD );
13    ul = xtoul("A12CD00"c);
14    assert( ul == 0xA12CD00 );
15    ul = xtoul("FFFFFFFFFFFFFFFF"c); 
16    assert( ul == 0xFFFFFFFFFFFFFFFF );

Meta