Posted on 2003-12-04
Last Modified: 2010-05-03
someone wanna give me a brief explination of what parsing is?  how to do it? a simple code, maybe.  What i need to do it.. just the basics

Question by:learning_t0_pr0gram
  • 2
  • 2
LVL 26

Expert Comment

ID: 9877369
Parsing what?

Parsing string?

Accepted Solution

mccainz2 earned 20 total points
ID: 9877549

"I love milk"

now programatically find word "love" within the string

    Dim sParseMe, sLove As String
    Dim iLoveStart As Integer
    Dim iLoveEnd As Integer
    sParseMe = "I love Milk"
    iLoveStart = InStr(1, sParseMe, "love")
    iLoveEnd = InStr(iLoveStart, sParseMe, " ")
    sLove = Mid(sParseMe, iLoveStart, iLoveEnd - iLoveStart)
    MsgBox sLove

Author Comment

ID: 9877624
yes, but what if you wanted to get a word, but u didn't know what it was...

example: text from a website... like a profile or something

Expert Comment

ID: 9878122
well , you'd need to define something to parse on ... in your website example it may be an html or meta-tag....
You have to have some clue as to what you are looking for. For advanced parsing use the regular expression object , its basically the big cannon of this subject ....


And a question I answered (with complete source code) on parsing lottery numbers from a website

Author Comment

ID: 9878468
ok... i kinda understand a little now... what i'm trying to make is you type a Yahoo! ID and the password to it, and it tells u all the profiles on the account...

heres an example:

if you click that link, it will log you into a yahoo id and you can see that it has profiles

i want it to add the profiles to a list box


Default ID: (default id)
Profile 1: (profile 1)
Profile 2: (profile 2)

ect.. but when i try, it adds the first 2 ids, and then starts adding a bunch of nonsense
here is what i have, if u can tell me whats wrong with it:

Dim page, theDefID As String
Dim defStart As Integer
Dim defEnd As Integer
Dim sHowFar As Integer
Private Sub Command1_Click()
If id.Text = "" Then Exit Sub
If pw.Text = "" Then Exit Sub
page = Inet1.OpenURL("" & id.Text & "&passwd=" & pw.Text & "&.done=")
On Error GoTo blah
defStart = InStr(sHowFar + 1, page, "[<a href=""") + Len("[<a href=""")
defEnd = InStr(defStart, page, """>Edit</a>]")
theDefID = Mid(page, defStart, defEnd - defStart)
found.AddItem theDefID
sHowFar = sHowFar + defEnd
sHowFar = 0
Exit Sub
End Sub


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now