Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old May 17th, 2007, 08:29 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I reiterated from my previous post to place a Response.Write into the Case for MS and see if it executes. You focused on the Upper Case issue in your last post but did not say if you had placed the Response.Write into the Case.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #22 (permalink)  
Old May 17th, 2007, 09:19 AM
Authorized User
Points: 483, Level: 7
Points: 483, Level: 7 Points: 483, Level: 7 Points: 483, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: Edgewood, NY, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have tested the sState = ToUpper(sState). get an undefined error. Remember I am using ASP CLASSIC, not net!! asp classic uses UCASE for upper class. I tried UCASE, still does the same. only sends an email to what ever state is at the top of the list. I t will not send to other stastes at same time if there are more thaan one state...

Reply With Quote
  #23 (permalink)  
Old May 17th, 2007, 09:24 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You still havent answered my question.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #24 (permalink)  
Old May 17th, 2007, 09:33 AM
Authorized User
Points: 483, Level: 7
Points: 483, Level: 7 Points: 483, Level: 7 Points: 483, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: Edgewood, NY, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, I aded response.write myArray(i) & "<br>" and it only shows the first state in the list. So there must be something going on in the case code that is "dropping" the other states...

Reply With Quote
  #25 (permalink)  
Old May 17th, 2007, 09:38 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Well, I don't know what to tell you then. I just tested this code and it works fine:

<%
Dim warehouse, MyArray
warehouse="NY,MS"
MyArray = Split(warehouse,",") 'the delimiter is the comma

For I = 0 to UBound(MyArray)
  sState = MyArray(I)
  SELECT CASE sState
    Case "NY"
       response.write "NY <BR>"
    Case "MS"
       response.write "MS <BR>"
   END SELECT
Next
%>

It writes out NY and MS to the screen just as it should.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #26 (permalink)  
Old May 17th, 2007, 10:17 AM
Authorized User
Points: 483, Level: 7
Points: 483, Level: 7 Points: 483, Level: 7 Points: 483, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: Edgewood, NY, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok dparsons. I sincerely apologize for my inexperience here. I am an avid web designer and html coder. Coding is an entirly other animal for me.

I have tested as you showed, and it works like a charm IF I hard code the states in there. What is baffling me is that why when I use warehouse = request.form("warehouse"), it only shows one state? If I place <%=warehouse%> on the page, it clearly shows all the states that appear in that field, but when I put back in warehouse = request.form("warehouse"), it apparently only pulls in one state? I thought the logic made sense, but I guess not. any thoughts?

Reply With Quote
  #27 (permalink)  
Old May 17th, 2007, 10:22 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hmm. Let me ask you this:

When you request the value from the form does the string look like this:
NY,MS

or does it look like this:
NY, MS

In the case of the latter, what would be happening is that your string is going to split into your array ALMOST as you expect.

ArrayElement[0] == "NY"
ArrayElement[1] == " MS" '<--Notice you have leading whitespace

So, in this case that is why the Case for MS (or any subsequet States) fails because "MS" <> " MS" hence it is not a correct case.

Use the Trim() Function to remove your Leading and trailing whitespace.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #28 (permalink)  
Old May 17th, 2007, 01:01 PM
Authorized User
Points: 483, Level: 7
Points: 483, Level: 7 Points: 483, Level: 7 Points: 483, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: Edgewood, NY, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dparsons,
Thank you sooo much. It worked! I use LTrim. works like a charm, very time! I appreciate your help. You are truly knowledgable.
I will be sure to pick your brain in a month for now on another topic!

Reply With Quote
  #29 (permalink)  
Old May 17th, 2007, 01:08 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

LOL. Glad you got it worked out. Ill see you in a month =P

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract part of String carrie09 Access 6 August 24th, 2007 10:04 AM
set password equal to variable fizzerchris SQL Server 2005 3 April 30th, 2007 01:45 AM
Getting Part of a String needelp Access VBA 4 September 19th, 2006 06:22 AM
Use a variable as a part of an XPath? NotesSensei XSLT 2 July 7th, 2004 04:10 AM
Conversion part of string to date MRvLuijpen Access 5 May 18th, 2004 02:31 PM



All times are GMT -4. The time now is 08:24 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.