How do I stop my e-mail subscription?
breaking a line of code to two lines
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ColdFusion > breaking a line of code to two lines 24 September 2008 03:51:32

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

breaking a line of code to two lines

Daniel Kessler 24 September 2008 03:51:32
 I need to break a line of code onto a second line while keeping it as
a line of code. I have the following array and when I use the value
"Jerry Wrenn Scholarship" as a value in a radio button, when I
retrieve the value from the db, it doesn't match the original value
in an CFIF statement. When I make it all on on line, the CFIF works
fine. How do I do this sort of soft-return?

<cfset fund_ar = listToArray("The Dean's Fund,Health and Society
Visiting Professorship,
Jerry Wrenn Scholarship,Kinesio­logy Gift Fund)

In the example above, I've shortened the entries. I need this to
make the code manageable.

--
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD 20742-2611
301-405-2545 Phone
www.phi.umd.edu

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlan­ta.com

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:4:188465
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/4
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:4
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13123.11886.4
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4

Add comment
Daniel Kessler 21 December 2004 23:14:53 permanent link ]
 
Well, you could break on commas, and always trim().

I do break on commas. I didn't trim though. I thought that was just for spaces. There none. I'll try it.
You could always replace line breaks with spaces.

I use Dreamweaver to code and I'm not sure how I would do that.
You could use an array and assign each row individually.

I have about 120 entries; one of the reasons that I'm splitting it up.
I could do 121 lines of code just to make an array, but I prefer not to which is why I use listToArray. I prefer to just be able to do <cfset = {1,2,3,4,5}> to init an array, like in actionscript, but don't believe that works.
You could do this programmatically using listappend().

OK, I looked that up and it seems applicable.
I'm sure there are others I'm not thinking of.

same here.

thanks for the help.

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynami­cs.com

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:4:188472
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/4
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:4
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13123.11886.4
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4

Add comment
Ben Doom 22 December 2004 00:01:47 permanent link ]
 Well, you could break on commas, and always trim().
You could always replace line breaks with spaces.
You could use an array and assign each row individually.
You could do this programmatically using listappend().

I'm sure there are others I'm not thinking of.

HTH.

--Ben

Daniel Kessler wrote:> I need to break a line of code onto a second line while keeping it as > a line of code. I have the following array and when I use the value > "Jerry Wrenn Scholarship" as a value in a radio button, when I > retrieve the value from the db, it doesn't match the original value > in an CFIF statement. When I make it all on on line, the CFIF works > fine. How do I do this sort of soft-return?>
<cfset fund_ar = listToArray("The Dean's Fund,Health and Society > Visiting Professorship,> Jerry Wrenn Scholarship,Kinesio­logy Gift Fund)>
In the example above, I've shortened the entries. I need this to > make the code manageable.>


~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlan­ta.com

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:4:188468
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/4
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:4
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13123.11886.4
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4

Add comment
Ryan Duckworth 22 December 2004 00:07:25 permanent link ]
 Can't you just set the array up like this?

<cfset fund_ar = ArrayNew(1)>

<cfset fund_ar[1] = "The Dean's Fund">
<cfset fund_ar[2] = "Health and Society Visiting Professorship">
<cfset fund_ar[3] = "Jerry Wrenn Scholarship">
<cfset fund_ar[4] = "Kinesiology Gift Fund">

You also could use a key, value pair... such as just putting "1" in the
radio button then using a lookup for the array. Passing the whole
string from the radio button does not seem necessary or practical in
this instance. Good luck!


Ryan Duckworth
Macromedia ColdFusion Certified Professional

Uhlig Communications
10983 Granada Lane
Overland Park, KS 66211
(913) 754-4272


-----Original Message-----
From: Daniel Kessler [mailto:danielk-e45ueOrobK4@public.gmane.org]
Sent: Tuesday, December 21, 2004 2:57 PM
To: CF-Talk
Subject: breaking a line of code to two lines

I need to break a line of code onto a second line while keeping it as
a line of code. I have the following array and when I use the value
"Jerry Wrenn Scholarship" as a value in a radio button, when I
retrieve the value from the db, it doesn't match the original value
in an CFIF statement. When I make it all on on line, the CFIF works
fine. How do I do this sort of soft-return?

<cfset fund_ar = listToArray("The Dean's Fund,Health and Society
Visiting Professorship,
Jerry Wrenn Scholarship,Kinesio­logy Gift Fund)

In the example above, I've shortened the entries. I need this to
make the code manageable.

--
Daniel Kessler

Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD 20742-2611
301-405-2545 Phone
www.phi.umd.edu



~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlan­ta.com

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:4:188470
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/4
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:4
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13123.11886.4
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4

Add comment
Ben Doom 22 December 2004 00:24:52 permanent link ]
 
Well, you could break on commas, and always trim().> I do break on commas. I didn't trim though. I thought that was> just for spaces. There none. I'll try it.

Ah, it must have been the wrap monster, then. Trim() removes all
whitespace from the beginning and end of the string.
You could always replace line breaks with spaces.> I use Dreamweaver to code and I'm not sure how I would do that.

I meant that you could do it programatically to the data on output (or
whatever). That is, you could use replace() to turn the hard returns
into spaces.
You could use an array and assign each row individually.> I have about 120 entries; one of the reasons that I'm splitting it> up. I could do 121 lines of code just to make an array, but I prefer> not to which is why I use listToArray. I prefer to just be able to> do <cfset = {1,2,3,4,5}> to init an array, like in actionscript, but> don't believe that works.>
You could do this programmatically using listappend().>
OK, I looked that up and it seems applicable.

If you are turning the list into an array, then using listappend() and
appending each line to the list will require as many lines of code as
the array declaration. If the reason you prefer listappend() to the
array stuff is the possibility of having to renumber, then you can
always use arrayappend().

--Ben


~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.­com

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:4:188473
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/4
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:4
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13123.11886.4
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4

Add comment
Daniel Kessler 22 December 2004 13:50:12 permanent link ]
 
Well, you could break on commas, and always trim().>> I do break on commas. I didn't trim though. I thought that was>> just for spaces. There none. I'll try it.>
Ah, it must have been the wrap monster, then. Trim() removes all >whitespace from the beginning and end of the string.

That's it; it's working now. It seems odd to trim something that's not user entered, but here I am.
If you are turning the list into an array, then using listappend() and >appending each line to the list will require as many lines of code as >the array declaration.

I thought listAppend() would take another list of several entries and then I could do 5 appends for 5 lines each line with several entries, but it doesn't appear to work that way.

thanks for the help.

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynami­cs.com

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:4:188513
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/4
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:4
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13123.11886.4
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4

Add comment
Carlos Balacuit 22 December 2004 21:28:20 permanent link ]
 You could try:

<cfset fund_ar = listToArray(
"The Dean's Fund," &
"Health and Society," &
"Visiting Professorship," &
"Jerry Wrenn Scholarship," &
"Kinesiology Gift Fund",
",") />

--
Carlos Balacuit
Macromedia Certified ColdFusion MX Advanced Developer

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlan­ta.com

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:4:188565
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/4
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:4
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13123.11886.4
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4

Add comment
Guest 13 December 2007 17:34:40 permanent link ]
 http://www.it529.com­
http://www.china-la­pelpin-center.com/
http://www.come-in-­china.com
http://www.51231.cn­
http://www.pjgou.co­m
http://www.seotips.­com.cn
http://www.gdzk.net­.cn
http://www.seotips.­com.cn
http://www.shoe-who­lesale.net
http://www.solar-ce­ll-panel.com
http://www.wedding-­dress-gowns.com
http://www.boss529.­cn
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ColdFusion > breaking a line of code to two lines 24 September 2008 03:51:32

see also:
[JBoss Eclipse IDE (users)] - Re: No…
[EJB 3.0] - @GeneratedValue in…
[JNDI/Naming/Network] - Compression…
пройди тесты:
see also:
My Sister's B'day Wish for Me!!!
MY SISTER'S WORDS TO ME AFTER MANY MANY…
ONE VERSE THAT MADE ME LOVE MY SISTER…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .