title: VBScript : checking if the user input is an integer
body: <p>Within a VBScript, I need to make sure the user inputs a integer.</p>
  
  <p>Here is what I have now :</p>
  
  <pre><code>WScript.Echo "Enter an integer number : "
  Number = WScript.StdIn.ReadLine
  If IsNumeric(Number) Then
      ' Here, it still could be an integer or a floating point number
      If CLng(Number) Then
         WScript.Echo "Integer"
      Else
         WScript.Echo "Not an integer"
      End If
  End if
  </code></pre>
  
  <p>The problem is that CLng() doesn't test if my number is an integer : the number is converted anyway.</p>
  
  <p>Is there a way to check if a number is an integer ?</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>The suggested answer doesn't work as well for me. Here is a new version of my code :</p>
  
  <pre><code>WScript.Echo "Enter an integer number : "
  Number = WScript.StdIn.ReadLine
  If IsNumeric(Number) Then
     ' Here, it still could be an integer or a floating point number
     If Number = CLng(Number) Then
        WScript.Echo "Integer"
     Else
        WScript.Echo "Not an integer"
     End If
  End if
  </code></pre>
  
  <p>and here is the output :</p>
  
  <pre><code>U:\&gt;cscript //nologo test.vbs
  Enter an integer number :
  12
  Not an integer
  
  U:\&gt;cscript //nologo test.vbs
  Enter an integer number :
  3.45
  Not an integer
  </code></pre>