Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 14th, 2005, 08:08 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default split

I have a variable: contract_code_full

An example value for this variable is '40/IT5AFKLE'

I want to split it and store what is BEFORE the '/' in a new variable. i.e. the '40'

My Code:

<%
contract_code_full = Mid(Matches.Item(9).SubMatches(0), 2) & "<br />"
response.write "Contract Code (Full) = " & contract_code_full & "<br>"

contract_after_split = Split(contract_code_full,"/")
response.write "con = " & contract_after_split & "<br>"
%>

response.write "Contract Code (Full) = " & contract_code_full & "<br>" WORKS

response.write "con = " & contract_after_split & "<br>" DOESNT WORK.

Picco



www.crmpicco.co.uk
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old February 14th, 2005, 08:42 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please use this

<%
contract_code_full = Mid(Matches.Item(9).SubMatches(0), 2) & "<br />"
response.write "Contract Code (Full) = " & contract_code_full & "<br>"

contract_after_split = Split(contract_code_full,"/")
str_split_first = contract_after_split(0)
response.write "con = " & str_split_first & "<br>"
%>

Shibu Narayanan
Software Associates
 
Old February 14th, 2005, 08:48 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

thanks. i tried this:

<%
contract_code_full = Mid(Matches.Item(9).SubMatches(0), 2) & "<br />"
response.write "Contract Code (Full) = " & contract_code_full & "<br>"

contract_after_split = Split(contract_code_full,"/")
for i=0 to 0(contract_after_split)
cont_post_split = Split(contract_after_split(0),"/")
response.write "contract = " & (contract_after_split(0)) & "<br>"
'response.write "cont_post_split = " & cont_post_split & "<br>"
next
cont = contract_after_split(0)
response.write cont
%>

www.crmpicco.co.uk





Similar Threads
Thread Thread Starter Forum Replies Last Post
To Split or Not to Split darrenb Access 2 February 8th, 2008 12:28 PM
split() darkhalf Javascript 1 October 21st, 2005 11:34 AM
Split crmpicco VB How-To 6 May 17th, 2005 04:16 AM
Split database rylemer Access 1 August 30th, 2004 05:33 PM
help using split command chrisangus@btinternet.com Beginning VB 6 2 June 23rd, 2003 12:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.