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

What is keyword view?

808


How to make qtp understand the difference amongst the same type of objects .suppose there are 5 check boxes in a page and I have to choose the 2nd one, how to do that through script?

766


descriptive program for a yahoo mail that is in yahoo mail suppose check box mailid subject assume it is like this format all things are in webtable the question is suppose some mail ids are there in that mailids i want to select the check box wich is before a@gmail.com and after that i want to click on delete button

2021


Explain the use of action split in qtp?

798


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

2039


what type of framework u r using in ur organization

1857


This is Karthic and my mail id is karthic.venkitapathi@gmail.com, please give me an idea to crack qtp 10

1743


Anybody plz give, How do you test aframe in a web page? If page cotain text message or Images, tables?

1865


is there any addin for remedy user application

2016


Describe how Smart Identification is used

1920


How many types of trigger events are there in qtp?

778


What are the types of object repository?

862


How to export quicktest professional (qtp) results to an .xls file?

829


What is Cross browser testing? Does UFT support it?

826


Dis advantages of XML checkpoint ?

1789