Reply
Old April 28th, 2003 Top | #1
 
cpugeniusmv's Avatar
Computer Genius
Joined: April 2003
Posts: 485
Reputation: 50
Power: 116

Default Visual Basic String Manipulation

Here's what I'm trying to do.

VB6

I'm trying to get the source code of an EXTREMEMLY LONG page (delimited by the greater than symbol, ">") into a listbox.

However, I've run into a problem: Whenever I split() it with the ">" delimiter, when it gets to about the 1922nd 'delimit' it says that the subscript is out of range.

Suggestions?
cpugeniusmv is offline   Reply With Quote
Old April 28th, 2003 Top | #2
Blitzkrieg
 
Blitzkrieg's Avatar
Unregistered
Posts: n/a

Default

I don't completely understand what you are trying to do, can you give an example of the input, the output, and what code you are currently using? I'll take a look and see what I can do.
  Reply With Quote
Old April 28th, 2003 Top | #3
 
cpugeniusmv's Avatar
Computer Genius
Joined: April 2003
Posts: 485
Reputation: 50
Power: 116

Default

dim working as String

text1.text = (attached html source)

private sub command1_click()
x=-1
do until working = "Take me to the bottom</a"
x=x+1
working = Split(text1.text, ">")(x)
loop
do until working = vbcrlf & "<a name=bot"
x=x+3
working = Split(text1.text, ">")(x)
list1.additem working
loop
end sub

what this SHOULD do is give me all those text files with a "</a" on the end into list1. but when it get's to about the 1920th one, it says that it's out of range.
cpugeniusmv is offline   Reply With Quote
Old April 28th, 2003 Top | #4
 
X-Istence's Avatar
*
Joined: December 2001
Location: USA
Posts: 6,496
Reputation: 2808
Power: 220

Default

if you dont mind, attach the source code, ill take a look at it.
X-Istence is offline   Reply With Quote
Old April 28th, 2003 Top | #5
Blitzkrieg
 
Blitzkrieg's Avatar
Unregistered
Posts: n/a

Default

Like X-Istence said, attach the code and a copy of the html file you are using if possible.

If what you are trying to do is what I think, this would be insanely easy to do if you had Unix/Linux commands to work with. This stuff is ez as pi with it
  Reply With Quote
Old April 28th, 2003 Top | #6
 
cpugeniusmv's Avatar
Computer Genius
Joined: April 2003
Posts: 485
Reputation: 50
Power: 116

Default

*sigh*

i feel so stupid...found my mistake.

thanks anyway guys!
cpugeniusmv is offline   Reply With Quote
Old April 28th, 2003 Top | #7
Blitzkrieg
 
Blitzkrieg's Avatar
Unregistered
Posts: n/a

Default

Can I take a guess? The condition was never being met, so it would keep going even past the end of the input data, and give you an error...hence the out of range error.

Anyways, good to know that you got it working
  Reply With Quote
Old April 28th, 2003 Top | #8
 
cpugeniusmv's Avatar
Computer Genius
Joined: April 2003
Posts: 485
Reputation: 50
Power: 116

Default

correction:

it was working

i'll post the source in a second.
cpugeniusmv is offline   Reply With Quote
Old April 28th, 2003 Top | #9
 
cpugeniusmv's Avatar
Computer Genius
Joined: April 2003
Posts: 485
Reputation: 50
Power: 116

Default

another correction:

i found a way around it.

sheesh.
cpugeniusmv is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with visual basic 6 saithe Web Design & Coding 1 December 28th, 2005 6:20am
visual basic.net help GhoulScout Web Design & Coding 13 December 16th, 2004 1:12am
Visual Basic 6 adamg Web Design & Coding 3 November 13th, 2003 5:35am
Visual Basic JJH35 Web Design & Coding 2 January 31st, 2003 2:41pm
Visual Basic 6.0 rickang Web Design & Coding 1 March 21st, 2002 1:22am