Dear list:

This is the very first time I post something, although I've been signed up
to it for years. I'd like to greet you all first of all :)

My problem is the following:

Whenever I have a form and I send its contents to another cf document, if
one of the fields was empty, it interprets the variable as not existant. I.e.

<input name="testtext" type="text">

On the next page, if I left that field blank, when trying to do a
#testtext# it says it doesn't exist.

That problem wouldn't be so big if it wasn't that today I realized that it
happens with loops. For example:

<cfloop index="nopi" list="black||yellow| |green" delimiters="|">
<cfoutput>My Color is: #nopi# </cfoutput><br>
</cfloop>

It returns:

My Color is: black
My Color is: yellow
My Color is:
My Color is: green

See what I mean? Since the 2nd element is empty, the internal variable just
doesn't exist...

What I was programming was a script to read a |-delimited text file to
update a sql database. Imagine the mess the above problem caused in the
poor table..

Which brings a second question. Is there an /easy/ or /direct/ way to make
a script to update a database's table with a delimited text file? I'm first
looping through each line (that works) and then looping through each column
(with the token) and then I'm doing an 'update' sql query for each field
depending on the number of the loop.. But there must be an easier way, I'm
sure... I just can't figure it out.

Thanks to everybody for the help they may provide. :)

KDJ.
__  __  ___  ____
| \/ / |   \ \__ | JC1: "Que pasa, tio?!" \\\\\\
|   <  | |> \   || JC2: "El tiempo.." //////////
|_/\_\ |____/   /|    http://www.disneymania.org
  ______________//  http://www.amazingdollars.com
/______________/ http://www.lionking.org/~nyanya
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to