By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,475 Members | 1,929 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,475 IT Pros & Developers. It's quick & easy.

Dropping a comma

P: n/a


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!
Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
> 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.)
Jul 22 '05 #2

P: n/a
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" <no*****@nospam.org> wrote in message
news:ut**************@tk2msftngp13.phx.gbl...


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!

Jul 22 '05 #3

P: n/a

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!
Jul 22 '05 #4

P: n/a
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" <no*****@nospam.org> wrote in message
news:eK**************@TK2MSFTNGP15.phx.gbl...

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!

Jul 22 '05 #5

P: n/a
Use the Replace method
strAddr = Replace (strAddr, ",","")
then Trim it.

"Micromanaged" <no*****@nospam.org> wrote in message
news:ut**************@tk2msftngp13.phx.gbl...


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
Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.