473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Find a changing value in a text box with the help of non changing data

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
Sep 16 '07 #1
2 1210
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.

Expand|Select|Wrap|Line Numbers
  1.  
  2. dim strSplit 
  3. strSplit = Split(txtbox.text, 'customer base-') 
  4. 'strSplit(0) ' should be <body> .. customer base-
  5. 'strSplit(1) 'should be 2200..</body>
  6.  
looks like there's a space after your numeric. in that case, use mid with the results of instr to find this white space:

Expand|Select|Wrap|Line Numbers
  1.  
  2. dim strResult as string 
  3.  
  4. strResult = strSplit(1)
  5. strResult = mid(strResult, 1, Instr(1, strResult, ' ') - 1) 
  6.  
  7.  
Sep 16 '07 #2
Killer42
8,435 Expert 8TB
Keep in mind, the RichTextBox control has methods built in to do this sort of selection. I don't recall what they are right now, but should be able to look them up at lunch time.
Sep 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Margaret MacDonald | last post by:
I'm a js novice trying to teach myself. I'm using Flanagan's 'Javascript, the definitive guide' from O'Reilly as a text. But either I'm dopier than usual or its layout doesn't match my learning...
7
by: Stefan Finzel | last post by:
Hi, is there a way to change the display property on Windows Mobile 2003 SE Mobile/Pocket Internet Explorer? See following example. Please note: visibilty property has the same problem. Is...
3
by: MS | last post by:
What's the best way to "store" and display a value in a text box that changes from day to day. An example of this would be where the name of the user is manually typed in after using the datbase,...
2
by: John Smith | last post by:
Hey folks, I've got a combobox (DropDown List) in a windows form application which is bound to a DataSet. It's value is set to a numeric ID. It's visible text is set to a date. I need to make...
2
by: Chris Fink | last post by:
This should be relatively simple but I am unable to find an asp:button tag in a datalist footer. I have tried it numerous ways including the FindControl method from the many events that the...
2
by: Aaron Smith | last post by:
Has anyone had their IDE do this before? I have 3 grids that are bound to related tables. They are each in their own tab page. Grid1 - DS.Table1.Table2 Grid2 - DS.Table1.Table2.Table3 Grid3 -...
13
by: PW | last post by:
Hi, This is bizarre. I've check and rechecked the spelling, cut and paste the name of the form (when trying to rename the form) and the control yet I still get a parameter prompt when the form...
2
by: John | last post by:
Hi Everyone, I have a question about dynamically changing the length of a varchar(n) field, in case the value I'm trying to insert is too big and will give a "truncated" error, but before the...
4
by: John Kotuby | last post by:
Hi all, I have a simple user-form which accepts contact and profile information for the user to edit and save. All the textboxes are working fine and displaying the expected data, both when the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.