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

Hi all can any one give me roles and responsibilities for QTP (not WINRUNNER)

3215


Explain the concept of how quicktest professional (qtp) identifies object?

573


Functions call by reference and call by value. i want the diff b/n these 2 and how will be the script for this?in which situation we use these 2..?pls explain me clearly

1251


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

1712


Hi, I am using OutputCheckPoint for 2 webelements Bed:4 and Bath:2 Full,1 partial in my result page and I am storing the value in the data table. I dont need the string Bed:4,I would like to get only the no 4. How can I get it? Even though I highlight only 4,It is seleting the full value "bed 4". Same thing happend for second webelement Bath:2 Full,1 partial I need only the No 2. I used the following to split MyArray = Split(UIBathResult, " ", -1, 1) But it is giving the value My Array(0)=Bath:2full,1Partial I need the only the nos for further comparision.Any help? Thanks Uma

3240






What is checkpoints for quicktest professional?

547


can i change the runtime properties of an object ? How can i check if a parameter exists in database ?

1410


How does qtp identify the object in the application?

533


What is the extension of the qtp local repository? If it is .mtr then what is .bdb extension stands for?

568


Explain the concept of how quicktest professional identifies object?

532


What is file database?

1688


Explain about Test Fusion Report of QTP?

611


Please provide specific examples of advanced/creative usage of QTP, including how impact & benefits for your project

1638


What is keyword view?

561


How many add-ins comes by default with qtp?

537