long HexToInt(char *msgline)
{
long strlength,chvalue,tvalue;
WORD i;
chvalue=0;
strlength=strlen(msgline);
for(i=0;i<strlength;i++)
{
if(msgline[i]==' ')
continue;
tvalue=msgline[i]-48;
if(tvalue>9)
{
tvalue=tvalue-7;
}
chvalue=chvalue+tvalue*(IntPower(16,(strlength-i-1)));
}
return chvalue;
}