Thanks all - the built in function is exactly what I needed. I am fairly new to
CF so I will definitely spend time learning the functions. Thanks again.
~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-C
> Wow: LJustify(), RJustify(), and CJustify() functions. Who
> woulda thunk it. Brilliant. I guess.
Whenever I'm working with people relatively new to CF my number one
piece of advice is to become very familiar with the function reference
so you don't spend a bunch of time re-writing functions th
Wow: LJustify(), RJustify(), and CJustify() functions. Who woulda
thunk it. Brilliant. I guess.
On 22 August 2011 17:37, Justin Scott wrote:
>
>> I'm attemping to create a function that adds spaces either
>> in front of or behind a string.
>
> Hi Josh, a couple of things. First, ColdFusion has
just off the top of my head:
function spaceFiller(cell, fill, align) {
var space = RepeatString(' ', fill - Len(Cell));
return iif(align eq 'R', de(space & cell), de(cell & space));
}
You may need to deal with the scenario of cell having more characters
than the value of fill. Also, if
If you're displaying this in a browser, then HTML is likely the culprit,
condensing multiple spaces into just one. Use non-breaking spaces (or wrap
your output in tags) to get HTML to output multiple spaces.
On Mon, Aug 22, 2011 at 11:19 AM, Josh Cesana wrote:
>
> I'm attemping to create a func
> I'm attemping to create a function that adds spaces either
> in front of or behind a string.
Hi Josh, a couple of things. First, ColdFusion has the LJustify(),
RJustify(), and CJustify() functions which will do exactly what you're
trying to accomplish already built in.
Second, your function (
I'm attemping to create a function that adds spaces either in front of or
behind a string. For example, I want this "test" string to have 6 spaces after
it, plus the 4 characters in "test" for a total of 10 characters. I have an
"align" variable for both left and right alignment for the spaces.
I am trying to follow what you are wanting to accomplish with this.
You are setting htmlcontent to the string value 'htmlcontent' plus the
current 'count' value.
Then you are sending the htmlcontent1 variable (which doesn't appear to
exist) to the ToScript function? I think htmlcontent1 is part o
A side note; there's no need to maintain that 'COUNT' variable as CF does
this for you with the currentRow property of the cfquery object, so:
Dominic
On 28/01/2008, Dominic Watson <[EMAIL PROTECTED]> wrote:
>
> A random guess, but try removing all the cfoutput tags and wrap the whole
A random guess, but try removing all the cfoutput tags and wrap the whole
lot in one cfoutput tag. Perhaps it is a whitespace thing...(?)
Dominic
> I've got most of this working. I'm just having a hard time getting the cf
> variables
> to parse out when naming the javscript function. Everythin
>>Also can anyone recommend a good way to troubleshoot Javascript errors?
Fire bug for FF
https://addons.mozilla.org/en-US/firefox/addon/1843
And debugbar for IE (Free for personal use)
http://www.debugbar.com/
On Jan 28, 2008 3:14 PM, <[EMAIL PROTECTED]> wrote:
> I've got most of this workin
I've got most of this working. I'm just having a hard time getting the cf
variables
to parse out when naming the javscript function. Everything works fine except
when I try and wrap a cf variable around the function name. Any ideas? Thanks.
Also can anyone recommend a good way to troubleshoot
for (i=0, i LT #listLen(form.fieldNames)#, i=i+1) {
if (listFindNoCase(form.roles, i, ",") {
writeOutput(i);
}
}
banged out really quickly...but hopefully will do what you need (or at
least, get you started on the right track)
charlie
Trent Shepherd writes:
> I am hav
(formerly PIER System, Inc.)
[EMAIL PROTECTED]
voice : 360.671.8708 x12
fax : 360.647.5351
www.audiencecentral.com
> -Original Message-
> From: Trent Shepherd [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 25, 2003 8:37 AM
> To: CF-Talk
> Subject: cfscript help
>
>
>
us/blog
> Yahoo IM : morpheus
>
> "My ally is the Force, and a powerful ally it is." - Yoda
>
> > -Original Message-
> > From: Trent Shepherd [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, March 25, 2003 10:37 AM
> > To: CF-Talk
&g
iginal Message-
From: Trent Shepherd [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 16:37
To: CF-Talk
Subject: cfscript help
I am having a block on rewriting the following in cfscript
#fnames#
thanks in adv
10:37 AM
> To: CF-Talk
> Subject: cfscript help
>
>
> I am having a block on rewriting the following in cfscript
>
>
>
>
>
>
>
> #fnames#
>
I am having a block on rewriting the following in cfscript
#fnames#
thanks in advance
trent
~|
Archives: http://www.houseoffusion.com/cf_lists/ind
> > ref = insert('0',ref,0);
is better.
> -Original Message-
> From: Ryan Mitchell [mailto:[EMAIL PROTECTED]]
> Sent: 02 January 2003 12:35
> To: CF-Talk
> Subject: Re: Cfscript help
>
>
> Brilliant this worked... thanks, didn¹t realise you nee
t; should it not be
> ref = insert('0','#ref#',0);
>
>> -Original Message-
>> From: Ryan Mitchell [mailto:[EMAIL PROTECTED]]
>> Sent: 02 January 2003 12:21
>> To: CF-Talk
>> Subject: Re: Cfscript help
>>
>>
>> Brackets
insert() returns a string, but you're not setting ref as the new string.
Therefore you get an infinite loop
BTW, you should ditch the use of ##s
Taz
> Brackets were wrong - thanks, but its still times out!
> Any other thoughts?
> ryan
~~~
2003 12:21
To: CF-Talk
Subject: Re: Cfscript help
Brackets were wrong - thanks, but its still times out!
Any other thoughts?
ryan
On 2/1/03 12:12, "Mike Townend" <[EMAIL PROTECTED]> wrote:
> Could be the brackets... Try...
>
>
> while (len(#
Have you considered that ref does not actually get bigger?
should it not be
ref = insert('0','#ref#',0);
> -Original Message-
> From: Ryan Mitchell [mailto:[EMAIL PROTECTED]]
> Sent: 02 January 2003 12:21
> To: CF-Talk
> Subject: Re: Cfscript help
>
>
>
> -Original Message-
> From: Ryan Mitchell [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 2, 2003 12:07
> To: CF-Talk
> Subject: Cfscript help
>
>
> Hey
>
> Why does the following cfscript take absolutely AGES to load?
>
>
>
Could be the brackets... Try...
while (len(#ref#) LT 5)
{
insert('0','#ref#',0);
}
-Original Message-
From: Ryan Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 2, 2003 12:07
To: CF-Talk
Subject: Cfscript help
Hey
Why does the fol
Hey
Why does the following cfscript take absolutely AGES to load?
while (len(#ref# LT 5)) { insert('0','#ref#',0); }
Ryan
** posted to the cf-linux list by accident -- oops!
~|
Archives: http://www.houseoffusion.com/cf_lists
> >> > I'm not sure what makes a variable "good" in this case, but if you
> >> > offer more information, perhaps I can offer more information.
> >>
> >>I'm checking the value of a date to make sure it's legal. (I've had no
> >>end of problems with the date parsing side of CFINPUT so I'm figur
s in year."; }
tempdate = CreateDate(year,month,1);
if (day gt daysinmonth(tempdate)) { return "Date exceeds days in
month."; }
date = CreateDate(year,month,day);
return DateFormat(date,"mm/dd/yyyy");
}
Bill Henderson
[EMAIL PROTECTED]
--
Not sure aobut the months other than using
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Nov) ... though it looks like your
regex has a few extra characters...
> ReFind("^([0-9]{1,2})([[:punct:]]|[[:space:]]){1,}[0-9]{1,2}?(([[:punct:
]]|[[:space:]]){1,}([0-9]{2}|[0-9]{4}))$",date))
Looking at it... this
;mm/dd/");
}
#checkDate(form.mydate)#
Bill Henderson
[EMAIL PROTECTED]
-Original Message-----
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 11:31 AM
To: CF-Talk
Subject: Re: CFSCRIPT help
> At 01:46 PM 6/27/02 -0400, S. Isa
At 02:16 PM 6/27/2002 -0400, you wrote:
> > At 01:57 PM 6/27/2002 -0300, you wrote:
> >>At 12:45 PM 6/27/02 -0400, Jeffry Houser wrote:
> >> > I'm not sure what makes a variable "good" in this case, but if you
> >> > offer more information, perhaps I can offer more information.
> >>
> >>I'm ch
> At 01:46 PM 6/27/02 -0400, S. Isaac Dealey wrote:
>>function validDate(mydate) {
>> if (not
>> ReFind(mydate,"[0-9][0-9]?/[0-9][0-9]?/[0-9][0-9][0-9][0-9]")) { return
>> "Inavlid Date Mask"; }
>> var day = listfirst(mydate,"/");
>> var month = listgetat(mydate,2,"/");
>>
> At 01:57 PM 6/27/2002 -0300, you wrote:
>>At 12:45 PM 6/27/02 -0400, Jeffry Houser wrote:
>> > I'm not sure what makes a variable "good" in this case, but if you
>> > offer more information, perhaps I can offer more information.
>>
>>I'm checking the value of a date to make sure it's legal.
At 01:49 PM 6/27/02 -0400, S. Isaac Dealey wrote:
> > How many variables can I return with a CFSCRIPT block?
>
>You mean with a UDF ? ... As many as you want ... as long as they're all
>part of the same complex object like a query, structure or array ...
Sorry, I meant a UDF. Thanks for this as
At 01:50 PM 6/27/02 -0400, Jeffry Houser wrote:
> Are you saying that you are being given April 5th (I.e. 4/5/2002) and the
>system is seeing it as May 4th (5/4/2002)? What are the problems with
>EuroDate validation?
This is exactly the problem. Eurodate sometimes takes the date correctly
an
At 01:46 PM 6/27/02 -0400, S. Isaac Dealey wrote:
>function validDate(mydate) {
> if (not
> ReFind(mydate,"[0-9][0-9]?/[0-9][0-9]?/[0-9][0-9][0-9][0-9]")) { return
> "Inavlid Date Mask"; }
> var day = listfirst(mydate,"/");
> var month = listgetat(mydate,2,"/");
>
I want to make sure I clarify that CFScript blocks and UDF functions are
two completely different things.
In a UDF, you can only return a single value. That value can be a
complex value (Array or Structure), though.
CFScript blocks don't explicitly return any values, although you can
cr
> How many variables can I return with a CFSCRIPT block?
You mean with a UDF ? ... As many as you want ... as long as they're all part of the
same complex object like a query, structure or array ...
function foo() {
var myreturn = new Structure();
myreturn.hello = "hello";
> I'm passing the date entered and the date mask. The UDF pulls out the
> value of the date (day, month and year fine) but I want to be able to
> check to see if it is a legal day and month before making it into an
> ODBC date.
>
> So I'm doing something like this:
>
> Check to see what mask is w
At 01:22 PM 6/27/02 -0400, Jeffry Houser wrote:
> I do worry that you are re-inventing the wheel. Have you looked at the
>IsDate or LSIsDate function?
> I'm not sure if ColdFusion has a specific way to compare against a given
>mask, though, but if your intent is to turn it into an ODBC date,
At 01:57 PM 6/27/2002 -0300, you wrote:
>At 12:45 PM 6/27/02 -0400, Jeffry Houser wrote:
> > I'm not sure what makes a variable "good" in this case, but if you offer
> >more information, perhaps I can offer more information.
>
>I'm checking the value of a date to make sure it's legal. (I've had
At 12:45 PM 6/27/02 -0400, Jeffry Houser wrote:
> I'm not sure what makes a variable "good" in this case, but if you offer
>more information, perhaps I can offer more information.
I'm checking the value of a date to make sure it's legal. (I've had no end
of problems with the date parsing side
This is, sadly, one of the worst documented features of ColdFusion.
A whole chapter is devoted to it in ColdFusion: A Beginner's Guide. (
Most everything in the book still applies to ColdFusion MX)
http://www.amazon.com/exec/obidos/ASIN/0072191090/instantcoldfu-20
I'm guessing you want t
www.houseoffusion.com/docs/cfscript.htm
At 12:11 PM 6/27/02, you wrote:
>Can someone suggest a good book or site on CFSCRIPT? I'm trying to write a
>script that will test a variable and if the variable is good, do some
>calculations on it and return the finished value, but if it's bad, it'll
Can someone suggest a good book or site on CFSCRIPT? I'm trying to write a
script that will test a variable and if the variable is good, do some
calculations on it and return the finished value, but if it's bad, it'll
break out with an error message. Other than nesting a lot of ifs, I can't
om: Jeff W [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 3:58 PM
To: CF-Talk
Subject: The mysterious CFSCRIPT.. Help
I am interesting in learning cfsript
Has anyone seen any tutorials on the web? Is there any books written on it??
To me it seems there is not alot information
-4301 Alexandria, VA 22304
http://www.csmi.com
> -Original Message-
> From: Jeff W [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 08, 2001 3:58 PM
> To: CF-Talk
> Subject: The mysterious CFSCRIPT.. Help
>
>
> I am interesting in learning cfs
www.houseoffusion.com/script.ppt
Michael Dinowitz
Publisher: Fusion Authority weekly news alert
(www.fusionauthority.com/alert)
Listmaster: CF-Talk, CF-Jobs, Spectra-Talk, Jrun-Talk, etc.
(www.houseoffusion.com)
> I am interesting in learning cfsript
>
> Has anyone seen any tutorials on the we
I am interesting in learning cfsript
Has anyone seen any tutorials on the web? Is there any books written on it??
To me it seems there is not alot information in even the current cold fusion
books about it. I know its supposed to be simmilar to javascript and
somewhat asp. I've seen SOME cfscript
49 matches
Mail list logo