// Hex2dec // // Takes a single digit hexidecimal number and returns a decimal value // // Written By Sean Hyde-Moyer (Copywrite 1995-2003) // This program is released to the public under the terms of the // GNU GENERAL PUBLIC LICENSE // See http://www.gnu.org/copyleft/gpl.txt // For the full text of the license agreement hex2dec: thehex { decimalnum = 0; if(number(thehex) >= 0) { decimalnum = number(thehex); } else { thehex = strupper(thehex); if(thehex == "A") decimalnum = 10; if(thehex == "B") decimalnum = 11; if(thehex == "C") decimalnum = 12; if(thehex == "D") decimalnum = 13; if(thehex == "E") decimalnum = 14; if(thehex == "F") decimalnum = 15; } return(decimalnum); }