473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dropping a comma



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
5 1207
> 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
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Alberto Vera | last post by:
Hello: I have the next structure: How Can I make it using Python? How Can I update the value of 6?
4
by: Arne | last post by:
From: "Arne de Booij" <a_de_booij@hotmail.com> Subject: Comma delimited array into DB problems Date: 9. februar 2004 10:39 Hi, I have an asp page that takes input from a form on the previous...
5
by: Derek | last post by:
I came upon the idea of writting a logging class that uses a Python-ish syntax that's easy on the eyes (IMO): int x = 1; double y = 2.5; std::string z = "result"; debug = "Results:", x, y,...
2
by: benben | last post by:
I am looking for a good example of overloading operator , (operator comma) Any suggestions? Ben
11
by: Shawn Odekirk | last post by:
Some code I have inherited contains a macro like the following: #define setState(state, newstate) \ (state >= newstate) ? \ (fprintf(stderr, "Illegal...
21
by: siliconwafer | last post by:
Hi, In case of following expression: c = a && --b; if a is 0,b is not evaluated and c directly becomes 0. Does this mean that && operator is given a higher precedence over '--'operator? as...
9
by: Wayne | last post by:
I have the following string: "smith", "Joe", "West Palm Beach, Fl." I need to split this string based on the commas, but as you see the city state contains a comma. String.split will spilt the...
12
by: ckirby | last post by:
I've got a csv that I am trying to import into a SQL Server (2000) table through an adp (Access 2000). The form used gives the user the ability to browse for a file, then will import the file into...
15
by: Lighter | last post by:
In 5.3.3.4 of the standard, the standard provides that "The lvalue-to- rvalue(4.1), array-to-pointer(4.2),and function-to-pointer(4.3) standard conversions are not applied to the operand of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.