*copy and paste it in to qtp 

use the function which i created below  ,this will work fine 

*


String_increase "arun22","10"


Function String_increase(sString,iCount)' count (like how many iteration u 
want to increase the count)
   If not isempty(sString) Then
       Dim x(),c(),j,k,S()'declare array for getting the extracted value 
from the strings 
       j=0
       k=0
       ReDim x(len(sString))'just redim to the length of the string 
       ReDim c(len(sString))
       ReDim s(len(sString))
       For i=0 to len(sString)-1
           x(i)=mid(sString,i+1,1)'using mid function  extract  each letters
           If isnumeric(x(i)) Then'during iteration if the numeric part 
comes then store it in to an array 
               c(j)=x(i)'stores numeric val
               j=j+1'increase the temp array count
               else 
               s(k)=x(i)'stores string val
               k=k+1'increase array
           End If
       Next
       'join the string ..if u  use  join function then u landup in a 
problem thats what i  used this method
     For each a in s
         If not isempty(a) Then
             Fstring=fstring&a    
            
            end if
     Next
     'same like above join the numeric
      For each a in c
         If not isempty(a) Then
             fnum=fnum&a    
         
            end if
     Next
    'now  iterate up to the count u want  and increase the val like 
arun01,arun01,arun03
    If not isempty(fstring) Then'check  if the variable contains some value 
before proceeding
        For i=0 to icount
    
            output=fstring&int(fnum+i)
            print  output
        
        Next
    End If
    
    
   End If
End Function


'make  this script  as much as robust like  checking the variable contains 
string or not ,,,because sometimes empty  rows will be retrived from excel
' so fo that u need to make this script sa much as robust (error handling)




-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to