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
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 |
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 |
how can we test load time of an page in webtesting?
How to capture a window in qtp or how to take snapshot of any window while writing script in qtp
how to capture data from images in QTP and produce them in excel sheet?
How to call a function in QTP?
Write a code check the checkbox in the web table which is in the 4th row and fifth column (Use child item concept)
How to test the login page in different ways in automation testing and i need code?
how to test one edit box using Java addin for Web Applications? write script?
Name the properties you would use for identifying a browser and page when using descriptive programming?
who is the best faculty in HYD? Nageshwar rao or GC reddy?
hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me
hai,i want to select an option from the right click pop up menu.but the qtp is not recognizing the right click pop up menu as a seperate object.can any one tell me the solution.
How to export(copy) the entire webtable from the webpage into Excelsheet? using Vb scripting