ColdFusion Programming/Form results in a text file

Advertisement


Question
Answer   Here is the problem it looks like

<cfloop from="1" to="#blankLen#" index="x">
<cfset myString = "#myString#">
</cfloop>

You have to add a blank space to myString each loop thru. I tried putting & n b s p ; in there but it didn't show up if I put all the letters together.

Right now it appears that you are just setting myString = myString which does nothing.

You may have to adjust the number of blank spaces added by doing blankLen-1.

Another way to do this without having to do a loop is use the RepeatString function.

So you would create your blanks by doing this:

<cfset myString = "#myString#RepeatString(' ',#blankLen#)">

Once again you may have to put & n b s p ; in there (removing the blanks.
-----------------------------------------------

I am a little confused.  This function is for every other form field right?  Does this count from the first space up until the formfield start position? for example lets say  fname starts at 7 (size 30) lname starts at 37 (size 30)
mname starts at 67 (size 30).  How would this be written?

I can't understand why this is confusing me,  I am usually good at this.

Answer
You have to tell it what form fields you want to work on. So each field has its own set of code. This puts it in the order you want it in.

You will have to actually count out each block and figure out where it will end and start. Like I said, it should only be off by 1 space.

ColdFusion Programming

All Answers


Answers by Expert:


Ask Experts

Volunteer


Donald Hammond

Expertise

Expert in ColdFusion, Flash ActionScript, XML, and SQL.

Experience

Cold Fusion, Flash Action Script

©2012 About.com, a part of The New York Times Company. All rights reserved.