Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int hexval(string s)
- {
- int a = 0;
- s = strupper(s);
- while(s != "") {
- string x = strleft(s, 1);
- s = strright(s, strlen(s)-1);
- int n = strval(x);
- if(x == "A") n = 10;
- if(x == "B") n = 11;
- if(x == "C") n = 12;
- if(x == "D") n = 13;
- if(x == "E") n = 14;
- if(x == "F") n = 15;
- a = a * 16 + n;
- }
- return a;
- }
- extern void object::New()
- {
- string s = "303132";
- while(s != "") {
- int x = hexval(strleft(s, 2));
- s = strright(s, strlen(s)-2);
- message(x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement