How to find given string is palindrome or not without using
strreverse() function?

Answers were Sorted based on User's Feedback



How to find given string is palindrome or not without using strreverse() function?..

Answer / amiricks

Hi Nitin concept is correct but above code is not working fine
as it shows only not a palindrome....

here i have written one simple code any suggestions are most
welcome

val = Inputbox("Enter any string")
L= LEN(val)
for i = L to 1 step -1
v= mid(val,i,1)
va = va&v
Next
if val= va then
msgbox "Name is a Palindrome"
Else
Msgbox "Not a palindrome"
End if


Regards
Amit
umesh.amitkumar@gmail.com

Is This Answer Correct ?    15 Yes 2 No

How to find given string is palindrome or not without using strreverse() function?..

Answer / nitin jagjivan

Strng = "NITIN"
temp = "Pass"
dim arr()

Strng_Length = len(Strng)
redim arr(Strng_Length)

For i=1 to Strng_Length
arr(i-1)= mid(Strng,i,1)
Next

For i=1 to round(Strng_Length/2)
If instr(ucase(arr(i-1)),arr(Strng_Length-
i)) = 0 then
temp = "Fail"
End If
Next

If temp <> "Fail" then
msgbox "Given input is a palindrome"
Else
msgbox "Try another String, Not Pali"
End If

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More QTP Interview Questions

What is dictionary object? what is the use of it? How you will display all the items in the dictionary object?

1 Answers   Bank Of America,


Hi,All How to change background color of a cell in excel using qtp and that too with out using Excel Object.(I am importing the excel sheet by using ImportSheet method)

1 Answers  


Hi can anyone pls suggest how to fetch username(system login name)and system name in to qtp.I am not using TD or QC.Thx

5 Answers  


what is a test strategy & what is the difference between test strategy & test plan?

5 Answers  


What is the difference between the design-time and run-time data tables?

0 Answers  






how to parameterizing values from an excel sheet in Quick test professional?

1 Answers  


what is the use of automation objective model?where is used? plz tell me

2 Answers  


Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link

0 Answers  


Diff between WEB APPLICATION AND CLIENT-SERVER APPLICATION?

2 Answers  


Hi Small doubt . i am working as Contract employee in XYZ comany thrw ABC Consultancy. so. How i write my resume ? In Professional experience Column. plz send urgent

2 Answers  


Hi I have a doubt in qtp. Can you please clarify my doubt. If we are importing the data from excel sheet in qtp the the script is running the number of row times. I mean if there are 4 rows in excel sheet the script is running 4 times. cant we avoid this. suppose i have tis script: datatable.Import "C:\Documents and Settings\sailaja\My Documents\login1.xls" n = datatable.GetRowCount For i =1 to n systemutil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe" datatable.SetCurrentRow i Dialog("Login").WinEdit("Agent Name:").Set DataTable ("Username", dtGlobalSheet) Dialog("Login").WinEdit("Password:").Set DataTable ("Password", dtGlobalSheet) Dialog("Login").WinButton("OK").Click Window("Flight Reservation").ActiveX ("MaskEdBox").Type "020209" Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt" Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles" Window("Flight Reservation").WinButton("FLIGHT").Click Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click Window("Flight Reservation").WinEdit("Name:").Set "Sailaja" Window("Flight Reservation").WinButton("Insert Order").Click Window("Flight Reservation").WinMenu ("Menu").Select "File;New Order" window("Flight Reservation").Close next I created a excel sheet with 3 rows and 2 columns. (username and password). The script is running 9 times. I made the option run one itaration only . eventhough it is running 9 times .can u plaese clarify my doubt. Thankyou Sailaja.

3 Answers  


If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?

0 Answers  


Categories