Problem with Type Conversion

1. Matthew Kirwan Guest

Problem with Type Conversion

2. Senior Member
Join Date
Dec 1969
Posts
19,082

RE: Problem with Type Conversion

isNUmeric doesn&#039t check if something is an integer, it checks if it can be legally converted into an integer.<BR><BR>VBScript does a lot of implicit type conversion by itself, when required. CInt() will convert it into an integer, as you expect it to.<BR><BR>from the manual (which you should go and download) :<BR><BR>Visual Basic Scripting Edition Language Reference <BR><BR>--------------------------------------------------------------------------------<BR><BR>IsNumeric Function<BR>Returns a Boolean value indicating whether an expression can be evaluated as a number.<BR><BR>IsNumeric(expression)<BR><BR>The expression argument can be any expression.<BR><BR>Remarks<BR>IsNumeric returns True if the entire expression is recognized as a number; otherwise, it returns False. IsNumeric returns False if expression is a date expression.<BR><BR>The following example uses the IsNumeric function to determine whether a variable can be evaluated as a number: <BR><BR>Dim MyVar, MyCheck<BR>MyVar = 53 &#039 Assign a value.<BR>MyCheck = IsNumeric(MyVar) &#039 Returns True.<BR>MyVar = "459.95" &#039 Assign a value.<BR>MyCheck = IsNumeric(MyVar) &#039 Returns True.<BR>MyVar = "45 Help" &#039 Assign a value.<BR>MyCheck = IsNumeric(MyVar) &#039 Returns False.<BR>

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•