Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 12th, 2005, 5:48 AM   #1
crmpicco
Newbie
 
Join Date: Feb 2005
Posts: 13
Rep Power: 0 crmpicco is on a distinguished road
Split

How do i split this by "/"


heading_range = split(garulescolour(j), "/")
crmpicco is offline   Reply With Quote
Old May 12th, 2005, 8:49 AM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
for this to work heading_range has to be a array type varible.

dim heading_range() AS string

heading_range() = split(garulescolor(j), "/", vbTextCompare)

the split function returns a array, that's why you have to declair heading_range as one. Although, i can't remember if you have to redim it before filling it. Try it out. The vbTextCompare is optional, so you don't have to use it if you don't want to.

Note split is only for version 6.0 and up of VB.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old May 12th, 2005, 2:39 PM   #3
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Two things: you don't have to redim it, Piz, and you should probably remove the parentheses after "headingtext" on line 3.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 12th, 2005, 3:33 PM   #4
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Quote:
Originally Posted by Ooble
Two things: you don't have to redim it, Piz, and you should probably remove the parentheses after "headingtext" on line 3.

heh, can you tell that i hardly use VB anymore?
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old May 12th, 2005, 3:48 PM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I haven't used it in over a year, and I still know what I'm talking about. :p
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 12th, 2005, 3:57 PM   #6
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
yeah, it's almost two for me.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old May 13th, 2005, 6:52 PM   #7
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Quote:
Originally Posted by Ooble
Two things: you don't have to redim it, Piz, and you should probably remove the parentheses after "headingtext" on line 3.
Huh? There is no "headingtext" nor line 3...
Rory is offline   Reply With Quote
Old May 13th, 2005, 6:59 PM   #8
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Counting the whitespace. So the second line of code that Piz gave.
Dameon is offline   Reply With Quote
Old May 14th, 2005, 9:01 AM   #9
thomzor
Newbie
 
Join Date: Apr 2005
Location: The Netherlands
Posts: 20
Rep Power: 0 thomzor is on a distinguished road
dim blabla as string

blabla = "1/2/3/4/5"

dim third as string

third = split(blabla,"/",,vbtextcompare)(2)
thomzor is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:03 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC