get the order no from the following orderdetails
orderstring="ORD13456PNR"
eg:13456

Answers were Sorted based on User's Feedback



get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / mdbasha7862@gmail.com

orderstring="ORD13456PNR"

'we can use mid function

string1=mid(orderstring,3,5)
msgbox (string1)

Is This Answer Correct ?    9 Yes 2 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / phani

Dim text,num,only_text
text=inputbox("enter text")
n=len(text)
For i=1 to n
a=mid(text,i,1)
if isnumeric(a)=true then
num=num&a 'numbers are store in this
else
only_text=only_text&a 'text is stored
end if
Next
msgbox num
msgbox only_text

Is This Answer Correct ?    7 Yes 0 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / babu

The answers mentioned above will work only when we know the
format of the data entered.
But if you want to generalize the function.
We have to select each and every character from the string
and check when the character is a numberic of alphabet.
If it is numeric, then you can add it to a temporary
variable. So, we will get the value of the order number.

Is This Answer Correct ?    2 Yes 0 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / giriyappa badagar

ordStr="ORD13456PNR"

'we can use mid function

string=mid(ordStr,4,5)
msgbox (string)

OR

ordStr="ORD13456PNR"
msgbox right((left(ordStr,8)),5)

Is This Answer Correct ?    2 Yes 0 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / friend

i think we ll get order no exactly by using regular expression
concept......

orderstring="ORD13456PNR"
set r = new regexp
r.pattern="[0-9]+"
set n=r.execute(orderstring)
for each num in n
prrint n.value
next


am i correct.....

Is This Answer Correct ?    1 Yes 0 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / friend

no one is not given correct answer for dynamicaly how to write..plz give the answer for dynamicly hw to write.. we cant expect the number where its come next time right ..so at that time also we want to get correct output



thank u

Is This Answer Correct ?    1 Yes 0 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / srikanth

Dim mystring, myLength
mystring = "ORD13456PNR"
myLength = Len(mystring)

For i = 1 To myLength
If Asc(Mid(mystring, i, 1)) <> 32 Then
If Asc(Mid(mystring, i, 1)) >= 48 And Asc(Mid(mystring, i, 1)) <= 57 Then
myNumber = myNumber & Mid(mystring, i, 1)
End If
Else
msgbox("no numeric")
End If
Next
msgbox(myNumber)

Is This Answer Correct ?    1 Yes 0 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / nihar ranjan

orderstring="ORD13456PNR"

'we can use mid function

string1=mid(orderstring,4,5)
msgbox (string1)

'It will work definitely.......

Is This Answer Correct ?    1 Yes 0 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / raghu

ordStr="ORD13456PNR"

msgbox right((left(ordStr,9)),5)

Is This Answer Correct ?    1 Yes 1 No

get the order no from the following orderdetails orderstring="ORD13456PNR" eg:13456..

Answer / qtp

use instrrev or InStr and get the index position using the
search string as PNR
after that bye using the mid function we can get the order
number

var pos=instr(order string,"PNR")

string1=mid(orderstring,3,pos)

msgbox (string1)

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

what is web application and client server application.is there any difference ?

1 Answers   Wells Fargo,


can anyone tell me how to search a word/line in a document and to paste it in another file? Thanks in advance.

4 Answers  


How do we run the scripts in QTP ?? what are the three options....

4 Answers   HCL,


i'm testing the webpage with QTP, in this wabpage i have to choose the CV from the window, but QTP can't recognize the object, so i used the Low LEvel Recording, but every time i run the test, QTP go to halt when it gets to the Recorded part, any solution for that?( except puting delay in the script and manuall selecting, because i've did that)

0 Answers  


There are 4 webpages in an application, in third page there is one cancel button i want to click that cancel button only, how can I click that cancel buttton ?

4 Answers   Wipro,






What is the Difference Between Quick Test Pro and Quick test professional?

5 Answers   Infotech,


Hi All, I need Code For how to export Pass\Fail status to excell sheet without using QC. Thanks Balaji

3 Answers  


Write a script to customize the test results in PDF and HTML format.

0 Answers   DuPont,


When Recovery scenario actually starts while testing the application?

0 Answers   SAP Labs,


I am using environment variable xml to give credenatials for login into unix. Is there any way we cam mask the password in the xml?

0 Answers  


Where virtual objects stores results?

4 Answers  


how i can delete the excel process for the task manager using QTP

2 Answers  


Categories