codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Trouble w/strings in ASP  Archive Import (hopscotch) at 04:19 on Sunday, July 13, 2003
 

can anyone tell me why this code doesn`t work? Is is a data type problem? If so how can I fix it

Dim cc_type

if cc_type = "American Express" then
ect.

  Re: Trouble w/strings in ASP  Troy Wolf at 12:43 on Tuesday, July 15, 2003
 

There is nothing wrong with the code you posted. If the variable cc_type did indeed contain the value "American Express", that line would equate to TRUE. What you should do is something like this before this line to test the values:

Response.Write("<h2>|" & cc_type & "|</h2>")
Response.Flush
Response.End

The pipes will let you see if there are spaces before or after your value. Because "American Express " does not equal "American Express".

You can do this
if CStr(cc_Type) = "American Express", but this is not your problem here. You will commonly need to explicitly convert when dealing with integers such as

If CInt(cc_id) = 1 then ...
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: Trouble w/strings in ASP  Elain at 08:48 on Thursday, November 25, 2010
 

When you write the code, you shoule be careful, if you don't know how to write it, you can search the keyword"w/strings in ASP" in google, you will get the helpness!
--------------------------------------------------------
flash banner|logo maker|flash menu|drop down menu|flash decompiler mac









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: How to check number of fields in form?
•  Re: where can i post my programs to the world?
•  Re: DHTML tabletree
•  Re: Needed script or whatever it is
•  Re: navigation of control
•  Re: Image on a HTML button
•  Re: Trouble w/strings in ASP
•  Re: how to print a report having many records.
•  Re: Creating a simple client login / email database


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010