Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

i am new to qtp i do not know how to write script how to write the code to login if it fails how to able error messages

4 Answers   Accenture,


Plz send one Tracebilitymatrix example? Anybody working on Realtime QTP Plz give contact deatils?

1 Answers  


Hello Everybody, please tell me how to use accessibility checkpoint and XML checkpoint by giving any practical example of it.please provide me the steps to perform that and also pls provide the code too. Thanks in advance, Gaytri

1 Answers  


Which scripting language QTP is using?

6 Answers  


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s.

0 Answers  


Which functionalities of QTP used in banking project? pls any say answer?

0 Answers  


What are the types of object repository?

0 Answers  


WHAT IS DIFFERENCE B/W QC 9.2 AND QC 10.0

1 Answers   SoftTech,


what is the advatages of merging of object repositories in Qtp9.0

3 Answers   TCS,


what is localisation testing and globalisation testing? what is the difference between them?

1 Answers   CDC Software,


If u prepare bug report in Excel sheet . Is it possible to send thrw Test director? how it is?

3 Answers   Wipro,


plz tel me what is the differnce between QC & QTP?

3 Answers   iGate, Satyam,


Categories