Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Parsing...?

Posted on 2003-12-04
5
Medium Priority
?
269 Views
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

thanks
0
Comment
Question by:learning_t0_pr0gram
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9877369
Parsing what?

Parsing string?
0
 
LVL 5

Accepted Solution

by:
mccainz2 earned 80 total points
ID: 9877549
example

"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
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
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
0
 
LVL 5

Expert Comment

by:mccainz2
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 ....

RegExp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsjsgrpregexpsyntax.asp

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

http://experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Controls/Q_20430088.html
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
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:

http://login.yahoo.com/config?login=elves_look_like_some_green_shit&passwd=123456&.done=http://edit.profiles.yahoo.com/config/edit_identity?.src=ga&.done=http://games.yahoo.com/&.redir_from=REGISTRATION

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


like:

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("http://login.europe.yahoo.com/config?login=" & id.Text & "&passwd=" & pw.Text & "&.done=http://edit.profiles.yahoo.com/config/edit_identity?.src=ga&.done=http://games.yahoo.com/&.redir_from=REGISTRATION")
Do
On Error GoTo blah
defStart = InStr(sHowFar + 1, page, "[<a href=""http://profiles.yahoo.com/") + Len("[<a href=""http://profiles.yahoo.com/")
defEnd = InStr(defStart, page, """>Edit</a>]")
theDefID = Mid(page, defStart, defEnd - defStart)
found.AddItem theDefID
sHowFar = sHowFar + defEnd
Loop
blah:
sHowFar = 0
Exit Sub
End Sub

0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

597 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