Praise my soul the might king of heaven tribute to him bring
ransomed healed restored and all forgiven praise to him now sing
chorus:
then glory to our king sing all ye joyful strain
out voice will ever ring for his saving love form ne
praise him for his grace and for his favour when you were distressed
praise him still the same and sing forever may his name be blessed
father like he loves and ever spares us weak we are he knows
in his hands he ever gently bears us keeps us from our foes.
angels hel us rightly to adore him whilst you see his face
sun and moon and earth now bow before him praise him time and space
Saturday, April 23, 2011
Thursday, April 21, 2011
QTP : Example of Compare Text using InStr
Example of Compare Text for InStr
' Returns position 6
MsgBox InStr(1,"Moni Ajith Kumar","Ajith")
' Returns position 0 -
MsgBox InStr(7,"Moni Ajith Kumar","Ajith")
' Returns position 6
MsgBox InStr(1,"Moni Ajith Kumar","Ajith")
' Returns position 0 -
MsgBox InStr(7,"Moni Ajith Kumar","Ajith")
QTP : InStr with vbTextCompare vbBinaryCompare
Example Set 2: - String -"Todays India" Find the value "in"
' Position Value is 8 for "in"
MsgBox "Position of ""in"" is "& Instr(1,"Todays India","in",vbTextCompare)
' Returns Position Value 8
MsgBox "Position of ""In"" is "& Instr(1,"Todays India","In",vbTextCompare)
' Returns Position Value 0
MsgBox "Position of ""in"" is "& Instr(1,"Todays India","in",vbBinaryCompare)
' Returns Position Value 8
MsgBox "Position of ""In"" is "& Instr(1,"Todays India","In",vbBinaryCompare)
Example Set 2: Change Start position of Compare Text
' Returns 6
MsgBox InStr(1,"Moni Ajith Kumar","Ajith")
' Returns 0 -
MsgBox InStr(7,"Moni Ajith Kumar","Ajith")
' Position Value is 8 for "in"
MsgBox "Position of ""in"" is "& Instr(1,"Todays India","in",vbTextCompare)
' Returns Position Value 8
MsgBox "Position of ""In"" is "& Instr(1,"Todays India","In",vbTextCompare)
' Returns Position Value 0
MsgBox "Position of ""in"" is "& Instr(1,"Todays India","in",vbBinaryCompare)
' Returns Position Value 8
MsgBox "Position of ""In"" is "& Instr(1,"Todays India","In",vbBinaryCompare)
Example Set 2: Change Start position of Compare Text
' Returns 6
MsgBox InStr(1,"Moni Ajith Kumar","Ajith")
' Returns 0 -
MsgBox InStr(7,"Moni Ajith Kumar","Ajith")
QTP Find the Position of a String
'Find Position of the String "is" in a sentence
v_input_string="The Request is 123456"
v_text_to_find="is"
' Store the position
v_pos=InStr(1,v_input_string,v_text_to_find)
MsgBox "Position of the String ""is"" is : "&v_pos
MsgBox "Position of ""in"" is"& Instr(1,"Todays Developing India","In")
OutPut:
Position of the String "is" is 13
Position of "in" is 19
v_input_string="The Request is 123456"
v_text_to_find="is"
' Store the position
v_pos=InStr(1,v_input_string,v_text_to_find)
MsgBox "Position of the String ""is"" is : "&v_pos
MsgBox "Position of ""in"" is"& Instr(1,"Todays Developing India","In")
OutPut:
Position of the String "is" is 13
Position of "in" is 19
Subscribe to:
Posts (Atom)