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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / arun

'the above code was not working fine so i modified that

Validinteger 20,1,100


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
msgbox "Valid Number Thank You"
Else
msgbox "You must enter an integer between " & iMin &" and " & iMax
End If
Else
msgbox "You must enter a whole number"
End If
Else
msgbox "You must enter a number"
End If
End Function

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More QTP Interview Questions

Could anyone help me for the below scenario: i am using the descriptive programming for my account, in which we have to generate the contract in the MS-word. when i generate this doc, we need to click on enable macros to continue further. but i am unable to make qtp to click on this. if anybody faced the problem like this??? pls help to get it resolved? Thanks in advance

0 Answers  


Does QTP support Java Script also. Which is one is preferrable for QTP, VB script or Java script

18 Answers   IBM,


write script for how to add function library in QTP

2 Answers   Aspire,


How will you report the bug and explain the defect tracking sheet you handled?

0 Answers   TCS,


why was automation used in the project?

1 Answers   Google,






Qtp Automation Engineer , Can he login in VSS? What purpose he login In VSS? But Some companys are using CVS AND VSS ? some are Have log in in VSS Some Not login(not accessing) into VSS, not login persons are working on CVS? my doubt is, can Qtp automation engineer have loin in VSS or not? Where he store QTp Script?

3 Answers   CTC,


How will you handle java tree in qtp?

0 Answers  


Discuss the QTP Environment?

0 Answers  


Can we test GUI of the application using QTP.? How.?If possible briefly explain process.?

1 Answers   Wipro,


How to call a test from another test?

0 Answers  


Limitations in QTP?

0 Answers   CIL,


What is Object Spy?

8 Answers  


Categories