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

I want to capture data(using keyword) from msdos application using QTP?... Below is little work i could do on it... /* Set app=CreateObject("Wscript.shell") SystemUtil.run ("C:\Users\Agent\Desktop\pumpsim\PUMPSIM.EXE") Window(“PUMPSIM.EXE”).Activate wait(3) app.sendkeys "N" */ Thanks in advance...!!!

1438


Explain the check points in quicktest professional?

542


Write a QTP script to enter a keyword in to Google search engine?

651


While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?

1421


hai, i completed my b.tech in 2010 with 62.3%. i having knowledge on manual testing and Qtp. i want Relavent experience in testing.watever may be d salary i dont bother..I just want to gain knowledge. i dont have good communication skills.

1426






Hi! My OTP script has several bitmap checkpoints included which I check in the test results xml file. The test is for SAP 4.7. I need to save these bitmaps to files or at least export them to the html file using the export function in the test results viewer. Could you please help me with this problem? Thank you in advance! Best regards, Peter

2202


Explain about the test fusion report of quicktest professional (qtp)?

537


What is the use of text output value in quicktest professional (qtp)?

601


How to handle the exceptions using recovery secnario manager in quicktest professional (qtp)?

631


what testplan contents and what test strategy contents,what is the diff b/w them

1651


what type of run time errors you get while you ar edoing rpg program?

1513


What is QTP scenario.

1734


What is text/text area checkpoint?

564


I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.

1303


desribe a situation where u faced a stressful situation and how did u cope with it

1411