<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>VAL</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">VAL</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Converts numeric characters that occur at the beginning of a string to a number. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
A number. If conversion fails, returns zero.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Conversion functions, String functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>Val(string)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
IsNumeric
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
This function works as follows: 
</p>
<ul>

<li>If TestValue = &quot;234A56?7&#39;&quot;, Val(TestValue) returns 234.</li>

<li>If TestValue = &quot;234&#39;5678&#39;9?&#39;&quot;, Val(TestValue) returns 234.</li>

<li>If TestValue = &quot;BG234&quot;, Val(TestValue) returns the value 0, (not an error).</li>

<li>If TestValue = &quot;0&quot;, Val(TestValue) returns the value 0, (not an error).</li>
</ul>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;h3&gt;Val Example&lt;/h3&gt;
&lt;cfif IsDefined(&quot;FORM.theTestValue&quot;)&gt;
   &lt;cfif Val(FORM.theTestValue) is not 0&gt;
      &lt;h3&gt;The string &lt;cfoutput&gt;#DE(FORM.theTestValue)#&lt;/cfoutput&gt; 
can be converted to a number:
      &lt;cfoutput&gt;#Val(FORM.theTestValue)#&lt;/cfoutput&gt;&lt;/h3&gt;
   &lt;cfelse&gt;
      &lt;h3&gt;The beginning of the string &lt;cfoutput&gt;#DE(FORM.theTestValue)#
       &lt;/cfoutput&gt; cannot be converted to a number&lt;/h3&gt;
   &lt;/cfif&gt;
&lt;/cfif&gt;
&lt;form action = &quot;val.cfm&quot;&gt;
&lt;p&gt;Enter a string, and determine whether its beginning can be evaluated 
to a numeric value.
&lt;p&gt;
&lt;input type = &quot;Text&quot; 
   name = &quot;TheTestValue&quot; 
   value = &quot;123Boy&quot;&gt;
&lt;input type = &quot;Submit&quot; 
   value = &quot;Is the beginning numeric?&quot; 
   name = &quot;&quot;&gt;
&lt;/form&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="STRING">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">STRING</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>A string or a variable that contains one</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
