Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VBA Code to read a substring
#1
Not Solved
Hello All 

I am new to automation using UFT and new to programming as well. My question is around how to manipulate Substrings (a string within a string)
I want to find the position of a certain character in the string and find its start position and pass this start position to the mid function to capture the 
substring. The reason I need the position is because the position of the substring keeps moving. 

I also have it in a Do Loop Until 

Do
Window("Warehouse Management.ws").Type  micF5
Wait (2)
Window("Warehouse Management.ws").WinObject("Workstation ID:").Output CheckPoint("Workstation ID:_2")
L_Sline2 = DataTable.Value("G_Status_20",Global)
L_Status_20 = Instr(L_Sline2,"20 Print")
L_Status_20_Valid = mid(L_Sline2,L_Status_20,8)
Loop Until L_Status_20_Valid = "20 Print"

I keep getting the error "invalid procedure call or argument: 'mid'" The line with the error is underlined 

Could someone take a look at this one please......
Reply


Messages In This Thread
VBA Code to read a substring - by Dwarak Calayampundi - 09-07-2016, 09:30 AM
RE: VBA Code to read a substring - by Ankur - 09-07-2016, 04:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,304 07-10-2017, 04:20 PM
Last Post: rajeevk7
  Find out if QTP is running using VBA TurtleRock 0 2,167 09-07-2012, 04:53 PM
Last Post: TurtleRock
  VBA Application in Excel seema 0 1,830 08-28-2008, 04:29 AM
Last Post: seema
  Substring Anna 3 10,105 07-21-2008, 03:16 PM
Last Post: bhanu_bp7

Forum Jump:


Users browsing this thread: 1 Guest(s)