<search function="hexconv">
  <name>Base Conversion: Hexadecimal</name>
  <description>
    Convert hexadecimal values to decimal, octal and binary equivalents.<br/>
    <div class="helpboxDescLabels">Example:</div>
    <table class="helpboxDescTable">
  		<tr><td>hexconv 3A</td></tr>
  	</table>
  </description>
  <category>Functions</category>
  <contributor>Monty Scroggins</contributor>
  
  <script><![CDATA[
    function decfromhex(num) 
    {   
      return eval('0x' + num);
    }

    function hexconv(c)
    {
      if( nullArgs("hexconv",c) )
        return false;

	  var hex;
      if(c.substr(0,2) == '0x')
      { 
        hex = c.substr(2);
      }
      else
      {
        hex = c;
      }
    
      var dec = decfromhex(hex);
      var int = parseInt(dec);
      setSearchWindowText("hex: "+hex+
        "  dec: "+int.toString(10)+
        "  oct: "+int.toString(8)+
        "  bin: "+int.toString(2));
    }
  ]]></script>

  <copyright>
	Copyright (c) 2002 David Bau
	Distributed under the terms of the
	GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  </copyright>
</search>

