GET WHETHER THE GIVE NUMBER VALID OR NOT IN BETWEEN THE
GIVEN RANGE?IN VB SCRIPT(QTP)

Answer Posted / guest

Function ValidInteger(sNumber, iMin, iMax)
Dim iNumber
' Is it a number?
If IsNumeric(sNumber) Then
' Is it an integer?
If InStr(sNumber,".") = 0 Then
' Is it in the correct range?
If CLng(sNumber) >= iMin And CLng(sNumber) <= iMax Then
ValidInteger = "Valid Number Thank You"
Else
ValidInteger = "You must enter an integer between " & iMin &
" and " & iMax
End If
Else
ValidInteger = "You must enter a whole number"
End If
Else
ValidInteger = "You must enter a number"
End If
End Function
msgbox ValidInteger(9, 1, 10)

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If u r using library files (Instead of Check Points) , How do u do bitmap check ?

1557


Hi this is chandra if any one have Navigation of LAB QTP, I want Navigation of those tools, if any one have the and know the Navigation each and every part of the QTP, plz send me my mail naruboinac@yahoo. com,naruboinas@ gmail.com

1535


How to use conditional loops in qtp ?

680


Which is the best QTP training institute in Delhi/NCR region and what is the approximate fee for QTP course (Basics and Advanced)

1474


What is the difference between the design-time and run-time data tables?

637






What are the common defects found in your project? (in qtp interview)

1697


Hello Everyone, Please provide me the practical example of business component concept of QTP.Like how to create business component,how to connect the quality center etc.... Thanks in advance, Gaytri

1519


How do you create new test sets in td?

609


Explain the use of action split in qtp?

654


What is the synchronization point in qtp?

651


How do Parameterization and Data-Driving relate to each other in QTP?

667


can i compare two databases using QTP ?

1999


Does Low-level recording capture mouse movements?

672


What is 'sleep' in sync point?

713


what is the difference between IE & Netscape in web testing on a log in page

1905