Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Breaking up a string
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Breaking up a string

 Post Reply Post Reply
Author
vdub View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 February 2003
Location: United States
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote vdub Quote  Post ReplyReply Direct Link To This Post Topic: Breaking up a string
    Posted: 31 March 2003 at 3:02am

I have a problem that might be easy to solve. I have a string I need to break up into 3 values.

 

<option value="<%=poll_id%>,<%=topic_id%>,<%=forum_id%>"><%=Poll_question%></option>

 

This is a drop down box and when I process the results I need to break this string down to 3 values

 

1.)    poll_id

2.)    topic_id

3.)    forum_id

 

I have totally flaked on how to do this.

 

Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2003 at 3:40am

As long as the delimter is constant (such as the comma), you can split them into an array:

Dim aValues    'as array
aValues = split(yourstring,",")

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
vdub View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 February 2003
Location: United States
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote vdub Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2003 at 3:47am

yeah I got that far the part i am stuck on is spliting the values up.

poll_id = <%=poll_id%>

topic_id = <%=topic_id%>

forum_id = <%=foum_id%>

basicly what I am doing is adding a poll to my front page of my site using a list of polls from my forum. I am making a new page in the admin section to change these polls and want to just chose a poll to display from a drop down list. I have everything working but this string.

Back to Top
vdub View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 February 2003
Location: United States
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote vdub Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2003 at 4:20am

I got it working

heres the code I used

pollarray = split(pollstring,",")
pollid = pollarray(0)
topic_id = pollarray(1)
forum_id = pollarray(2)


it works great.

Thanks for your help Bunce you got me on the right track

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.