Dear friends,
I have written a little program to read the source of a web page into a Rich Text Box. Now I want to find a specific integer value in that text box and take it into a variable. That integer value in the web page changes from time to time, but the text before that integer won't change. How can I get the integer into a variable? please help me...
Eg: <body> .... Customer base- 2200..... </body>
here the non changing string is "Customer base-" and the changing integer is 2200
parse up to the location of 'Customer base-'
take everything afterwards.
a trick would be to split the string: first half having data up to customer base-, second half having remaining data.
-
-
dim strSplit
-
strSplit = Split(txtbox.text, 'customer base-')
-
'strSplit(0) ' should be <body> .. customer base-
-
'strSplit(1) 'should be 2200..</body>
-
looks like there's a space after your numeric. in that case, use mid with the results of instr to find this white space:
-
-
dim strResult as string
-
-
strResult = strSplit(1)
-
strResult = mid(strResult, 1, Instr(1, strResult, ' ') - 1)
-
-