Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / May 2006



Tip: Looking for answers? Try searching our database.

CrLf &CFML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PackinDaMAC - 26 May 2006 12:59 GMT
I have this code and it outputs these values of data that i have to a text file
all in one long line.....I wanted to know where do i put the CrLF in Coldfusion
to begin a new line....or what string values should i pass the
REReplaceNoCase()???? I just want to begin a new line after one section of
data.....:cool;

<td align="center" class="rightbottom"><input type="checkbox" name="mcall"
value="#pname# #dateseen# #res.phone# #loca# #vider#"></td>
jdeline - 26 May 2006 13:07 GMT
Well, the code you provided only produces a checkbox with no text next to it.  Are you  refering to the action page where the value of mcall is the long string of data set as a value?
PackinDaMAC - 26 May 2006 13:19 GMT
when i am writing to the file and i look at my file all my data that i write to
it is in one long line...I am writing those values of mcall to a file...but
when i look at the file all the data is in one line........where do i add my
CrLf so i can start a new line??

<cffile action="write" file="D:\PhoneReminder\msg.txt" addnewline="yes"
output="#mcall#">
Dan Bracuk - 26 May 2006 13:35 GMT
<blockquote>quote:<br><hr><i>Originally posted by: <b><b>PackinDaMAC</b></b></i>
when i am writing to the file and i look at my file all my data that i write
to it is in one long line...I am writing those values of mcall to a file...but
when i look at the file all the data is in one line........where do i add my
CrLf so i can start a new line??

<cffile action="write" file="D:\PhoneReminder\msg.txt" addnewline="yes"
output="#mcall#"><hr></blockquote>
This is how I send query results to a text file:
<cffile action="write" nameconflict="overwrite"
addnewline="no" output=""
file="d:\dw\dwweb\work\#CaseFileName#">

<cfoutput query="casedata">
<cffile action="append"
file="d:\dw\dwweb\work\#CaseFileName#"
output="#caseid#...etc...#chr(13)#">
</cfoutput>
jdeline - 26 May 2006 13:36 GMT
If you display your text in a table cell whose width is constrained, you can
get the word wrap you want.  Refer to this thread for more information <a
target=_blank class=ftalternatingbarlinklarge
href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=2&threa
did=1157252&enterthread=y">http://www.adobe.com/cfusion/webforums/forum/messagev
iew.cfm?catid=2&threadid=1157252&enterthread=y</a>
PackinDaMAC - 26 May 2006 14:49 GMT
That did not change my results to the file when i changed the table data to the
width of 300px............I have this data

datadatadatadatadatadatadata   I want it to look like

data
data
data
data
data

U cant just do something like <cfset crlf = CHR(10) & CHR(13)> and use the
varible like

<input type = "checkbox" value"#data##crlf# #data# #crlf# #data#>???? is that
not the correct way to do this.....
jdeline - 26 May 2006 15:20 GMT
Web browsers have no concept of CR/LF.  They <i>do</i> understand <BR> and <P>.
 So change your code to something like the following:

<cfset crlf = "<P>">
<input type = "checkbox" value"#data##crlf# #data# #crlf# #data#>
PackinDaMAC - 26 May 2006 15:49 GMT
When i used <P> all is did was show the string value <P>.....I get an error when dont add the quotes........and the same thing goes for <br> is there a certain way i need to add it?????
SafariTECH - 26 May 2006 22:38 GMT
He's writing to a TXT file, so the <P> nor <BR> tags will do anything, he has
to create a linefeed.

This problem is inter-related with another we started working on yesterday,
which is why the general understanding of the problem has been lost.

It would help PackinDaMAC, if you kept everything related to the entire
project in one thread :)

I answered you in your other post closer to the top about the same thing.
PackinDaMAC - 27 May 2006 00:02 GMT
Yea i know...it just seems that if you keep things in one thread too long no
one answers anymore....thanks for the info though......

I have two issues my textbox's if i change the dynamic infomation in them they
do not change in the textfile..is that due to the fact the all the txtboxes
have the same name ("pname")...????

.my 2nd issue is that when i use the #chr(10)chr(13)# it returns a new line
but it leaves a comma at the begining of each line.......
SafariTECH - 27 May 2006 21:03 GMT
I know what is happening here but I have a full weekend. I will be back here
next week to help you with this and have added it to my subscribed list so I
can find it easily when I get back.

In short, because you are putting all the data in the checkboxes to use as
what you write, the text fields will not update that data unless the form
refreshes.

I can help you with this when I get back if you don't figure it out before
then.
PackinDaMAC - 28 May 2006 13:21 GMT
Thanks I will be trying to figure it out over this long weekend....but please come back to help....thanks a bunch!!
PackinDaMAC - 30 May 2006 17:08 GMT
I added a counter varible and created the values in the names of all my
controls so they would all have thier individual names and then i loop through
only the mcall#i# that were defined and then wrote them to the file in a
string......Thanks for the help

<cfset cnt = 0>
   
   
    <cfloop query="res">
        <cfset cnt = cnt + 1>


--------------------------------------------------------------------------------
-------------------------------------------------------------
<cfloop from="1" to="500" index="i">
    <cfif IsDefined("mcall#i#")>
        <cfset str = "">
        <cfset str = str & Evaluate("pname#i#") & " , ">
        <cfset str = str & Evaluate("DateSeen#i#") & " , ">
        <cfset str = str & Evaluate("pnum#i#") & " , ">
        <cfset str = str & Evaluate("loca#i#") & " , ">
        <cfset str = str & Evaluate("vider#i#")>

        <cffile action="append" file="D:\PhoneReminder\msg.txt" addnewline="yes"
output="#str#">
    </cfif>

</cfloop>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.