What is InStr()

Answer Posted / mr. buntha khin

Sample code to use InStr() in VB.Net

Friend Function DecimolNumbers(ByVal KeyChar As Char, ByVal
TxtBox As TextBox) As Boolean

Select Case KeyChar.ToString

Case Keys.Delete.ToString
Return False
Exit Function
Case Keys.Left.ToString
Return False
Exit Function
Case Keys.Right.ToString
Return False
Exit Function
Case Keys.Tab.ToString
Return False
Exit Function
Case vbBack
Return False
Exit Function
Case Keys.Enter.ToString
Return False
Exit Function
Case Keys.Home.ToString
Return False
Exit Function
Case Keys.End.ToString
Return False
Exit Function
Case Keys.Escape.ToString

End Select

If (KeyChar.ToString = "." And InStr
(TxtBox.Text, ".") > 0) Then
Return True
Exit Function
End If

If KeyChar.ToString = "." Then Return False

If IsNumeric(KeyChar) = True Then
Return False
Else
Return True
End If

End Function

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I used child objects to get the no of weblist present in the weblist.now i need to select the items present in each weblist ?How to do so

2256


There are 10 rows in the datatable. How can we fetch 2 rows and then skip 3rd row. After that, pick 4th & 5th row and skip 6th row. Please share code

1214


in data driven testing for performing operations which method is easy from manual test data,keyword view,or from database.and why?

1359


HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?

1720


hi all can anyone explain how to write the code for finding the mandatory columns in table which are having (red*) (red Astrik)

1406






What do you to script when objects are removed from application?

618


when u script reveiwing in which area u more concentrates?

1418


What is regular expression?

581


What is the qtp testing process?

600


suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?

1328


how will you load the test cases in ddt?

1598


Suppose you are using shared objects repository in your test and you want to split your present action? At that time shared object repository is single or it’s also splits?

653


What is Curd testing?

1884


How does quicktest professional (qtp) identifies the object in the application?

583


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...!!!

1439