<html><!-- #BeginTemplate "/Templates/BookLayout.dwt" --><!-- DW6 -->
<head>
<!-- #BeginEditable "doctitle" --> 
<title>Untitled Document</title>
<!-- #EndEditable --> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.sheet1 {  font-family: Arial, Helvetica, sans-serif; clip:     rect(   ); text-indent: 10pt}
.header {  font-family: Arial, Helvetica, sans-serif; font-size: medium; font-weight: bold; clip:   rect(   )}
.code {  font-family: "Courier New", Courier, mono; padding-left: 20px}
.list {  font-family: Verdana, Arial, Helvetica, sans-serif}
.command {  font-weight: bold; font-family: "Courier New", Courier, mono; text-transform: uppercase}
-->
</style>
</head>

<body bgcolor="#FFFFFF" class="sheet1">
<!-- #BeginEditable "Header" --> 
<p class="header">Can I convert between numbers and strings?</p>
<!-- #EndEditable --> 
<table width="100%" border="0" height="25">
  <tr> 
    <td width="33%"><!-- #BeginEditable "Previous Page" --><a href="typesofarguments.html">Types 
      of Arguments</a><!-- #EndEditable --></td>
    <td> 
      <div align="center"><!-- #BeginLibraryItem "/Library/TOC Link.lbi" --><a href="../index.html">Table of Contents</a><!-- #EndLibraryItem --></div>
    </td>
    <td> 
      <div align="right"><!-- #BeginEditable "Next Page" -->{Next Page}<!-- #EndEditable --></div>
    </td>
  </tr>
</table>
<hr>
<!-- #BeginEditable "Body" --> 
<p>Yes! There are two commands related to conversion between numbers and strings: 
  <span class="command">atoi</span> and <span class="command">itoa</span>. You 
  need to convert between strings and numbers because only strings can be spoken 
  by a client (or put into a log) while only numbers can be used as arguments 
  to math commands.</p>
<p><span class="command">atoi</span> converts from a string to a number. The &quot;a&quot; 
  in <span class="command">atoi</span> stands for ASCII, which is a geek term 
  for a string character. The &quot;i&quot; stands for Integer, which means a 
  number with no decimals.</p>
<p><span class="command">itoa</span> converts from a number into a string. The 
  &quot;a&quot; and &quot;i&quot; in the name mean the same as in <span class="command">atoi</span>.</p>
<p>Both commands take one argument and leave one value on the stack, the result. 
  An example use of calculating a number and then having your client speak that 
  number would look something like:</p>
<p>1 2 + <span class="command">itoa</span> <span class="command">say</span></p>
<p>This would add the numbers 1 and 2 and cause your avatar to speak the number 
  &quot;3&quot;</p>
<!-- #EndEditable --> 
<hr>
<table width="100%" border="0" height="25">
  <tr> 
    <td width="33%"><!-- #BeginEditable "Previous Page 2" --><a href="typesofarguments.html">Types 
      of Arguments</a><!-- #EndEditable --></td>
    <td> 
      <div align="center"><!-- #BeginLibraryItem "/Library/TOC Link.lbi" --><a href="../index.html">Table of Contents</a><!-- #EndLibraryItem --></div>
    </td>
    <td> 
      <div align="right"><!-- #BeginEditable "Next Page 2" -->Next Page<!-- #EndEditable --></div>
    </td>
  </tr>
</table>
<p align="center"><i>Last Updated on <!-- #BeginEditable "TheDate" --><i>03/08/2000</i><!-- #EndEditable --></i>
</body>
<!-- #EndTemplate --></html>
