get the order no from the following orderdetails
orderstring="ORD13456PNR"
eg:13456
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Answer / raghu
ordStr="ORD13456PNR"
msgbox right((left(ordStr,9)),5)
Is This Answer Correct ? | 1 Yes | 1 No |
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 |
how to parameterizing values from an excel sheet in Quick test professional?
What are the Automation Limitations??
can i automate java web application using qtp web addin only not using java addin
Does QTP is "Unicode" compatible?
what is qtp automation framework, what is the purpose of the framework and which folders included in this framework pls tell me with brief description
what is meant by descriptive programming?
Plz Explain How to access Or Store Script from VSS? Explain Real time work (qtp) where you store folders and next to how to you access that folders and how you maintain folders in VSS ? What are the Menu's in VSS? Suppose in Manual, by using Checkin Checkout u can access documents. how you access in QTp REal time?
After running scripts how you report results ,there is any specific report form
what is clean sweep?
hello...any one tell me , where can i get company email id.. actually i am searching on testing... in my CV i put 3+ exp.. but all companies are asked company email id.. please provide solution for that... thanx in advance...
If you are using descriptive programming and you have two objects with the same name, so you are identiying them by name and index, how can you avoid errors if a third object with the same name is added at the begining of the page?
what r the main benefits of automation?