Dropping a comma

Discussion in 'ASP General' started by Micromanaged, Nov 15, 2004.

  1. Micromanaged

    Micromanaged Guest

    I am trying to post some data from the database to an XML file.
    Everything works except for a stray comma that comes from the database
    and exists at the end of the address string. For example, "123 Anywhere
    Street,"

    I would like to kill that comma that will always exist at the end of the
    address string.

    My initial thoughts:

    oldaddr = request.form(business_address)
    vbl = len(address) - 1
    newaddr = left(oldaddr, vbl)

    I tell it to do response.write on all variables involved, but for some
    reason the calculation is not being performed. No errors. What am I
    missing?




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Micromanaged, Nov 15, 2004
    #1
    1. Advertising

  2. > oldaddr = request.form(business_address)

    Uh, did you mean

    oldaddr = request.form("business_address")

    Big difference, with quotes and without. If that's what you actually have,
    than kindly cut & paste your actual code instead of re-writing it from
    memory.

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)
     
    Aaron [SQL Server MVP], Nov 15, 2004
    #2
    1. Advertising

  3. Micromanaged

    Mark Schupp Guest

    Are you sure the comma is always the last character (could there be a
    trailing blank perchance)?

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Micromanaged" <> wrote in message
    news:...
    >
    >
    > I am trying to post some data from the database to an XML file.
    > Everything works except for a stray comma that comes from the database
    > and exists at the end of the address string. For example, "123 Anywhere
    > Street,"
    >
    > I would like to kill that comma that will always exist at the end of the
    > address string.
    >
    > My initial thoughts:
    >
    > oldaddr = request.form(business_address)
    > vbl = len(address) - 1
    > newaddr = left(oldaddr, vbl)
    >
    > I tell it to do response.write on all variables involved, but for some
    > reason the calculation is not being performed. No errors. What am I
    > missing?
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Mark Schupp, Nov 15, 2004
    #3
  4. Micromanaged

    Micromanaged Guest

    I did screw up in the leaving out the quotes from the request.form when
    I posted my original comments. I made the change to the following line:
    oldaddr = request.form("business_address")
    and changed it to:
    oldaddr = trim(request.form("business_address"))
    which solved the problem.

    Thanks for the input (it was at least 1 trailing space).





    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Micromanaged, Nov 15, 2004
    #4
  5. Micromanaged

    Mark Schupp Guest

    You probably have a duplicate field name in the form. The 2 form field
    values would be separated by a comma and a blank when received from the
    form.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Micromanaged" <> wrote in message
    news:...
    >
    > I did screw up in the leaving out the quotes from the request.form when
    > I posted my original comments. I made the change to the following line:
    > oldaddr = request.form("business_address")
    > and changed it to:
    > oldaddr = trim(request.form("business_address"))
    > which solved the problem.
    >
    > Thanks for the input (it was at least 1 trailing space).
    >
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Mark Schupp, Nov 16, 2004
    #5
  6. Micromanaged

    Hal Rosser Guest

    Use the Replace method
    strAddr = Replace (strAddr, ",","")
    then Trim it.

    "Micromanaged" <> wrote in message
    news:...
    >
    >
    > I am trying to post some data from the database to an XML file.
    > Everything works except for a stray comma that comes from the database
    > and exists at the end of the address string. For example, "123 Anywhere
    > Street,"
    >
    > I would like to kill that comma that will always exist at the end of the
    > address string.
    >
    > My initial thoughts:
    >
    > oldaddr = request.form(business_address)
    > vbl = len(address) - 1
    > newaddr = left(oldaddr, vbl)
    >
    > I tell it to do response.write on all variables involved, but for some
    > reason the calculation is not being performed. No errors. What am I
    > missing?
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004
     
    Hal Rosser, Nov 17, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wendy Attenberger

    FileOpen Dropping Periods

    Wendy Attenberger, Dec 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    350
    Wendy Attenberger
    Dec 1, 2003
  2. luna
    Replies:
    1
    Views:
    343
    =?Utf-8?B?VHUtVGhhY2g=?=
    Feb 13, 2004
  3. spamfurnace
    Replies:
    1
    Views:
    326
    Natty Gur
    Jun 5, 2004
  4. tfs
    Replies:
    1
    Views:
    409
    John Saunders
    Jun 28, 2004
  5. Paul
    Replies:
    4
    Views:
    2,189
Loading...

Share This Page