Re: CFScript help

2011-08-22 Thread Josh Cesana

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-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346933
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFScript help

2011-08-22 Thread Justin Scott

> 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 that are
already built-in.  I recall one new developer back in 2001 who spent
nearly a day working on a function and ran into a snag.  He asked me
for help and after looking over his code for a moment I replaced his
entire file with one line, a function CF already had which would do
the same thing (getProfileString() in that case since he was trying to
read and parse .ini files).

Granted, the function list has grown by leaps and bounds with more
recent releases so even more experienced developers may not be fully
up-to-date in that area.

The white-space directive in CSS isn't something I was aware of so
even I am constantly learning. :)


-Justin

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346932
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFScript help

2011-08-22 Thread Dominic Watson

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 the LJustify(),
> RJustify(), and CJustify() functions which will do exactly what you're
> trying to accomplish already built in.
>
> Second, your function (at a glance) appears that it would work, but
> when you say you're only getting one space are you referring to the
> actual output, or just what you see on the browser screen after the
> page has been rendered?  Remember that in HTML, multiple spaces (or
> other whitespace in the output code) will get truncated down to a
> single space.  You could wrap the output with  tags to
> force it to show all of the whitespace as it exists in the code, or
> append the HTML character entity for a space instead ( ) to force
> multiple spaces to show in the output rendering.
>
>
> -Justin
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346930
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFScript help

2011-08-22 Thread Dominic Watson

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 you're spitting out html and want the
space to be visible, use white-space:pre in the css of the containing
element.

On 22 August 2011 17:19, Josh Cesana  wrote:
>
> 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. So 
> far, the only result I get is 'test ' instead of 'test      '
>
> 
>
>    function spaceFiller(cell, fill, align) {
>        var newcell = "";
>        if (len(cell) EQ 0) {
>            cell = " ";
>        }
>        newcell = cell;
>        for (i=1; i EQ len(fill - (len(cell))); i=i+1) {
>            if (align EQ "R") {
>                newcell = " " & newcell;
>            } else { newcell = newcell & " ";
>            }
>
>        }
>        return (newcell);
>    }
> 
>
> 
> 10 characters - align left: '#spaceFiller("test","10","L")#'
> 
>
> The result I get is 'test ' and what I want is 'test      '
>
> Any help would be much appreciated - thanks in advance.
> -J
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346929
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFScript help

2011-08-22 Thread morgan l

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 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.
> So far, the only result I get is 'test ' instead of 'test  '
>
> 
>
>function spaceFiller(cell, fill, align) {
>var newcell = "";
>if (len(cell) EQ 0) {
>cell = " ";
>}
>newcell = cell;
>for (i=1; i EQ len(fill - (len(cell))); i=i+1) {
>if (align EQ "R") {
>newcell = " " & newcell;
>} else { newcell = newcell & " ";
>}
>
>}
>return (newcell);
>}
> 
>
> 
> 10 characters - align left: '#spaceFiller("test","10","L")#'
> 
>
> The result I get is 'test ' and what I want is 'test  '
>
> Any help would be much appreciated - thanks in advance.
> -J
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346928
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: CFScript help

2011-08-22 Thread Justin Scott

> 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 (at a glance) appears that it would work, but
when you say you're only getting one space are you referring to the
actual output, or just what you see on the browser screen after the
page has been rendered?  Remember that in HTML, multiple spaces (or
other whitespace in the output code) will get truncated down to a
single space.  You could wrap the output with  tags to
force it to show all of the whitespace as it exists in the code, or
append the HTML character entity for a space instead ( ) to force
multiple spaces to show in the output rendering.


-Justin

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346927
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


CFScript help

2011-08-22 Thread Josh Cesana

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. So far, the 
only result I get is 'test ' instead of 'test  '


 
function spaceFiller(cell, fill, align) {
var newcell = "";
if (len(cell) EQ 0) {
cell = " ";
}
newcell = cell;
for (i=1; i EQ len(fill - (len(cell))); i=i+1) {
if (align EQ "R") {
newcell = " " & newcell;
} else { newcell = newcell & " ";
}
   
}
return (newcell);
}



10 characters - align left: '#spaceFiller("test","10","L")#'


The result I get is 'test ' and what I want is 'test  '

Any help would be much appreciated - thanks in advance.
-J 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346926
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: cfscript help using cfloop to name function with cf var - argh!

2008-01-28 Thread William Seiter
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 of the
database results.  If this is the case, then your set statement could be: 

 and then:
#toScript(htmlcontent,"html")#

Of course, I don't see where the resulting Javascript variable is being
used.  Plus, if you keep using the same variable name for 'html', then the
only one that will be available to the system on the browser end will be the
last one that was created, unless you move that line inside the 'function'
area where it will become a local variable rather than a global one.


For debugging, I use Firefox with the 'web developer 1.1.4' add-on.  

William
-- 
William E. Seiter
 
Have you ever read a book that changed your life?
Go to: www.winninginthemargins.com
Enter passkey: goldengrove
 
Web Developer 
http://William.Seiter.com




SELECT *
FROM tbl_flavor_party
WHERE FLV_PARTY_ID = #get_cand.FLV_PARTY_ID#


   
 
   
   #toScript(htmlcontent1,"html")#
   
function #showWindow#() {   

  var win = new Ext.Window({
 width:400,
 height:400,
 title:"#GET_PARTYNAME.FLV_PARTY# -
#get_cand.FLV_FLAVOR#",
 autoScroll:true,
 modal:true,
 html:html,
 animateTarget:"btnHello"
  });
  win.show();
   }   
   
 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297602
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cfscript help using cfloop to name function with cf var - argh!

2008-01-28 Thread Dominic Watson
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
> 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.  Everything works fine
> > except
> > when I try and wrap a cf variable around the function name.  Any ideas?
> > Thanks.
> >
>
>
>



-- 
Blog it up: http://fusion.dominicwatson.co.uk


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297598
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: cfscript help using cfloop to name function with cf var - argh!

2008-01-28 Thread Dominic Watson
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.  Everything works fine
> except
> when I try and wrap a cf variable around the function name.  Any ideas?
> Thanks.
>


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297596
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: cfscript help using cfloop to name function with cf var - argh!

2008-01-28 Thread Gerald Guido
>>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 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 Javascript errors?
> IE is such a big help. Not!  LOL.  Thanks.
>
>
> 
> 
> SELECT *
> FROM tbl_flavor_party
> WHERE FLV_PARTY_ID = #get_cand.FLV_PARTY_ID#
> 
> 
> 
> 
>   
>   #toScript(htmlcontent1,"html")#
>
> function #showWindow#() {
>
>  var win = new Ext.Window({
> width:400,
> height:400,
> title:"#GET_PARTYNAME.FLV_PARTY# -
> #get_cand.FLV_FLAVOR#",
> autoScroll:true,
> modal:true,
> html:html,
> animateTarget:"btnHello"
>  });
>  win.show();
>   }
>   
>  
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297594
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


cfscript help using cfloop to name function with cf var - argh!

2008-01-28 Thread coldfusion . developer
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 Javascript errors? 
IE is such a big help. Not!  LOL.  Thanks.




SELECT *
FROM tbl_flavor_party
WHERE FLV_PARTY_ID = #get_cand.FLV_PARTY_ID#


   
 
   
   #toScript(htmlcontent1,"html")#
   
function #showWindow#() {   

  var win = new Ext.Window({
 width:400,
 height:400,
 title:"#GET_PARTYNAME.FLV_PARTY# - 
#get_cand.FLV_FLAVOR#",
 autoScroll:true,
 modal:true,
 html:html,
 animateTarget:"btnHello"
  });
  win.show();
   }   
   
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297593
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: cfscript help

2003-03-25 Thread charlie griefer

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 having a block on rewriting the following in cfscript 
> 
>   
> 
>  
> 
>  
> 
> #fnames# 
> 
>  
> 
>  
> 
>   
> 
>   
> 
> thanks in advance 
> 
>   
> 
> trent 
> 
>   
> 
>   
> 
>   
> 
>   
> 
> 
> 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: cfscript help

2003-03-25 Thread Barney Boisvert

a = listToArray(form.fieldnames);
for (i = 1; i LTE arrayLen(a); i = i + 1) {
   if (listFindNoCase(form.roles, a[i]))
  writeoutput(a[i] & "");
}


Not quite a translation, but arrays are nicer than lists.

---
Barney Boisvert, Senior Development Engineer
AudienceCentral (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
>
>
> I am having a block on rewriting the following in cfscript
>
>
>
> 
>
> 
>
> #fnames#
>
> 
>
> 
>
>
>
>
>
> thanks in advance
>
>
>
> trent
>
>
>
>
>
>
>
>
>
>
> 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: cfscript help

2003-03-25 Thread Michael Dinowitz
See what happens when you don't sleep the last 22 hours; you forget that form
variables can be accessed like a structure and looped through using the for(key
in struct) syntax.


> for(key in form) {
> if(listFindNoCase(form.roles,key)) writeOutput(key & "");
> }
>
> ===
> Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)
>
> Email: [EMAIL PROTECTED]
> Blog : www.camdenfamily.com/morpheus/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
> > Subject: cfscript help
> >
> >
> > I am having a block on rewriting the following in cfscript
> >
> >
> >
> > 
> >
> > 
> >
> > #fnames#
> >
> > 
> >
> > 
> >
> >
> >
> >
> >
> > thanks in advance
> >
> >
> >
> > trent
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: cfscript help

2003-03-25 Thread Mike Townend
You could do something like


for (i=1; I lt ListLen(form.fieldnames); i=i+1)
{
if (ListFindNoCase(Form.FieldNames,
ListGetAt(Form.FieldNames, i)))
writeoutput(ListGetAt(Form.FieldNames, i) & "");
}



HTH



-Original 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 advance

 

trent

 

 

 

 



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: cfscript help

2003-03-25 Thread Raymond Camden
for(key in form) {
if(listFindNoCase(form.roles,key)) writeOutput(key & "");
}

===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email: [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/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
> Subject: cfscript help
> 
> 
> I am having a block on rewriting the following in cfscript
> 
>  
> 
> 
> 
> 
> 
> #fnames#
> 
> 
> 
> 
> 
>  
> 
>  
> 
> thanks in advance
> 
>  
> 
> trent
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
> 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



cfscript help

2003-03-25 Thread Trent Shepherd
I am having a block on rewriting the following in cfscript

 





#fnames#





 

 

thanks in advance

 

trent

 

 

 

 


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Cfscript help

2003-01-02 Thread Adam Reynolds
> > 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 needed to assign the
> insert, I thought it inserted it without!
> Oh well! thanks again!
> Ryan
>
> On 2/1/03 12:25, "Adam Reynolds" <[EMAIL PROTECTED]> wrote:
>
> > 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
> >>
> >>
> >> 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(#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 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/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



Re: Cfscript help

2003-01-02 Thread Ryan Mitchell
Brilliant this worked... thanks, didn¹t realise you needed to assign the
insert, I thought it inserted it without!
Oh well! thanks again!
Ryan

On 2/1/03 12:25, "Adam Reynolds" <[EMAIL PROTECTED]> wrote:

> 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
>> 
>> 
>> 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(#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 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/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



Re: Cfscript help

2003-01-02 Thread Taz
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

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



RE: Cfscript help

2003-01-02 Thread Mike Townend
You could try something like...


if (Len(Ref) LT 5)
{
Ref = NumberFormat(Ref, "9990.00");
}


Or something like that ?

HTH

Mikey


-Original Message-
From: Ryan Mitchell [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 2, 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(#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 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/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



RE: Cfscript help

2003-01-02 Thread Adam Reynolds
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
>
>
> 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(#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 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/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



Re: Cfscript help

2003-01-02 Thread Ryan Mitchell
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(#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 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/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: Cfscript help

2003-01-02 Thread Mike Townend
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 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/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



Cfscript help

2003-01-02 Thread Ryan Mitchell
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/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



Re: CFSCRIPT help

2002-06-27 Thread mark brinkworth

> >> >   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 figured I'd
> >>do it myself.)
>
> >   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, the
> > given mask doesn't matter if you use the CreateODBCDate function.
>
>How would CreateODBCDate() know the difference between 02/05/2002 and 
>05/02/2002? ... both are valid dates and both could represent the same two 
>dates, dependant upon who's entering it and whether or not they're in the 
>US...

You need to parse it to a CF Date Time object according to the locale.


   


Cheers,
Mark




__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CFSCRIPT help

2002-06-27 Thread Bill Henderson

Thank You, I have been successful in avoiding real work!

I added a check for month abbreviations, full month names, as well as a
check for th,nd,rd,st. I think I am finished.



function checkDate(date) {
date = ReReplace(date,"([[:punct:]]|[[:space:]])+","/","ALL");
date = ReReplaceNoCase(date,"(th|nd|st|rd)","","ALL");
mmm =
ListContainsNoCase("jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec",lis
tfirst(date,"/"));
if (mmm neq 0) { date =
ReplaceNoCase(date,listfirst(date,"/"),mmm); }
 =
ListContainsNoCase("january,february,march,april,may,june,july,august,se
ptember,october,november,december",listfirst(date,"/"));
if ( neq 0) { date =
ReplaceNoCase(date,listfirst(date,"/"),); }

if (not ReFind("^[0-9]{1,2}/[0-9]{1,2}/([0-9]{2}|[0-9]{4})$",date)) {
return "Inavlid date mask"; }
month = listfirst(date,"/"); 
day = listgetat(date,2,"/"); 
year = listlast(date, "/"); 
if (month gt 12) { return "Date exceeds months 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]

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 27, 2002 7:15 PM
To: CF-Talk
Subject: RE: CFSCRIPT help

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 in particular ([[:punct:]]|[[:space:]]){1,} may be
better represented by [[:punct:][:space:]]+ ... the outer pair of
brackets
[] makes the or | unnecessary... + ensures at least one character with
no
maximum, the same as {1,} ... and the parenthesis are generally
unecessary...

in retrospect, you may want to place this line :

date = ReReplace(date,"[[:punct:][:space:]]+","/","ALL");

prior to your ReFind for validation, which would then mean the
validation
ReFind() could be much simpler, which is always a good thing. :)

Then you could use something like FindOneOf(date,"Jan,Feb,Mar,Apr...")
(there may be a good list-udf for this at cflib.org) to determine if one
of
the items is a month abbreviation and return the list index...

> I am really just killing time trying not to get back to real work.
> Please help me achieve my goal.

Hope this helps! :)

Isaac

www.turnkey.to
954-776-0046


__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CFSCRIPT help

2002-06-27 Thread S . Isaac Dealey

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 in particular ([[:punct:]]|[[:space:]]){1,} may be
better represented by [[:punct:][:space:]]+ ... the outer pair of brackets
[] makes the or | unnecessary... + ensures at least one character with no
maximum, the same as {1,} ... and the parenthesis are generally
unecessary...

in retrospect, you may want to place this line :

date = ReReplace(date,"[[:punct:][:space:]]+","/","ALL");

prior to your ReFind for validation, which would then mean the validation
ReFind() could be much simpler, which is always a good thing. :)

Then you could use something like FindOneOf(date,"Jan,Feb,Mar,Apr...")
(there may be a good list-udf for this at cflib.org) to determine if one of
the items is a month abbreviation and return the list index...

> I am really just killing time trying not to get back to real work.
> Please help me achieve my goal.

Hope this helps! :)

Isaac

www.turnkey.to
954-776-0046

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: CFSCRIPT help

2002-06-27 Thread Bill Henderson

Just screwing around - I took the earlier post and tweaked it some. It
now has more function as a formatter than a validator. This function
allows the user to enter any punctuation or spaces between the numbers,
as well as extra punctuation (mistyped double hyphens and such) as long
as it falls between 3 sets of numbers. The user could enter
"mm-dd@@#/" and it would return "mm/dd/" I don't know why
this is useful, but it might be. This code also allows for 2 digit
years. 

If anybody has any shortcuts to check for word months (June, July, etc)
in the same function, I would love to know.

I am really just killing time trying not to get back to real work.
Please help me achieve my goal.


function checkDate(date) {
if (not
ReFind("^([0-9]{1,2})([[:punct:]]|[[:space:]]){1,}[0-9]{1,2}?(([[:punct:
]]|[[:space:]]){1,}([0-9]{2}|[0-9]{4}))$",date)) { return "Inavlid date
mask"; }
date =
ReReplace(date,"([[:punct:]]|[[:space:]]){1,}","/","ALL");
month = listfirst(date,"/"); 
day = listgetat(date,2,"/"); 
year = listlast(date, "/"); 
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/"); 
}

#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. 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,"/");
>> var year = listlast(mydate, "/");
>> tempdate = CreateDate(year,month,1);
>> if (day gt daysinmonth(tempdate)) { return "Date exceeds days
in
>> month."; }
>> return CreateDate(year,month,day);
>>}

> Wow!  This is why I read this list.  It shows me how much better other
> people are at CF than I am.  :)  Thanks.  I'd like to be able to
accept
> any mask (mm/dd/, dd/mm/, /mm/dd - depending on the
customer)
> so I guess I could add something to read the mask first and the pull
the
> information out in the correct order.

I wouldn't necessarily say "better" ... I may have been around the block
a bit longer ... You'll probably have to know in advance what format the
users are giving you the dates in (which I'm guessing you already do
based on your previous posts), so, you'd just add a parameter to the
function, so it'd be validDate(mydate,euro) ... then in the section
where you're setting the month and year, you determine which is which
based on that mask... 

var month = listgetat(mydate,iif(euro, 2, 1),"/");
var day = "listgetat(mydate,iif(euro, 1, 2),"/"); 

this will swap the month and day based on whether it's a european or a
us user entering the information... 

hope this helps, 

Isaac
www.turnkey.to
954-776-0046


__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Jeffry Houser

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 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 figured I'd
> >>do it myself.)
>
> >   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, the
> > given mask doesn't matter if you use the CreateODBCDate function.
>
>How would CreateODBCDate() know the difference between 02/05/2002 and 
>05/02/2002? ... both are valid dates and both could represent the same two 
>dates, dependant upon who's entering it and whether or not they're in the 
>US...

  A) Wouldn't it be up the user entering the information to enter the 
proper date?  How can you write a program to tell the difference between 
02/05/2002 and 05/02/2002?

  B) How does the SetLocale function fit into all of this?  Can't you use 
the LSIsDate function if you are expecting dates in a format other than 
mm/dd/yy?



--
Jeffry Houser | mailto:[EMAIL PROTECTED]
Need a Web Developer?  Contact me!
AIM: Reboog711  | Phone: 1-203-379-0773
--
My CFMX Book: 

My Books: http://www.instantcoldfusion.com
My Band: http://www.farcryfly.com 

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread S . Isaac Dealey

> 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,"/");
>> var year = listlast(mydate, "/");
>> tempdate = CreateDate(year,month,1);
>> if (day gt daysinmonth(tempdate)) { return "Date exceeds days in
>> month."; }
>> return CreateDate(year,month,day);
>>}

> Wow!  This is why I read this list.  It shows me how much better other
> people are at CF than I am.  :)  Thanks.  I'd like to be able to accept
> any mask (mm/dd/, dd/mm/, /mm/dd - depending on the customer)
> so I guess I could add something to read the mask first and the pull the
> information out in the correct order.

I wouldn't necessarily say "better" ... I may have been around the block a bit longer 
... You'll probably have to know in advance what format the users are giving you the 
dates in (which I'm guessing you already do based on your previous posts), so, you'd 
just add a parameter to the function, so it'd be validDate(mydate,euro) ... then in 
the section where you're setting the month and year, you determine which is which 
based on that mask... 

var month = listgetat(mydate,iif(euro, 2, 1),"/");
var day = "listgetat(mydate,iif(euro, 1, 2),"/"); 

this will swap the month and day based on whether it's a european or a us user 
entering the information... 

hope this helps, 

Isaac
www.turnkey.to
954-776-0046

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread S . Isaac Dealey

> 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 no
>>end of problems with the date parsing side of CFINPUT so I'm figured I'd
>>do it myself.)

>   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, the
> given mask doesn't matter if you use the CreateODBCDate function.

How would CreateODBCDate() know the difference between 02/05/2002 and 05/02/2002? ... 
both are valid dates and both could represent the same two dates, dependant upon who's 
entering it and whether or not they're in the US... 

Isaac 
www.turnkey.to
954-776-0046
__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Thane Sherrington

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 well.

T

__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Thane Sherrington

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 
and sometimes inverts the day and month (actually it always seems to invert 
the day and month if the day <=12.)  It could be something I'm doing but I 
couldn't get it to work so I started doing the validation myself on the 
server (which seemed safer to me anyway, since I can't be sure of the client.)

T

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Thane Sherrington

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,"/");
> var year = listlast(mydate, "/");
> tempdate = CreateDate(year,month,1);
> if (day gt daysinmonth(tempdate)) { return "Date exceeds days in 
> month."; }
> return CreateDate(year,month,day);
>}

Wow!  This is why I read this list.  It shows me how much better other 
people are at CF than I am.  :)  Thanks.  I'd like to be able to accept any 
mask (mm/dd/, dd/mm/, /mm/dd - depending on the customer) so I 
guess I could add something to read the mask first and the pull the 
information out in the correct order.

Thanks!

T

__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Jeffry Houser

  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 
create variables in any scope of your choosing that will be accessible.

  I'm still not fully understanding why it matters how the customer's give 
you the data, as long as it is in a valid date.   You'll just need to 
massage it before displaying it back to them, using the appropriate 
mask.  ( DateFormat?).

  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?




At 02:29 PM 6/27/2002 -0300, you wrote:
>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, the given
> >mask doesn't matter if you use the CreateODBCDate function.
>
>I may well be reinventing the wheel. :)  I do that all the time.  But my
>problem is I get customers who want mm/dd/ and others who want
>dd/mm/ and the eurodate validation doesn't always work (the day and
>month get swapped.)  So I wrote a basic CF program to handle this, but if I
>can do it as a UDF it would be much slicker (and give me some practice
>creating UDFs.)  Perhaps it is impossible to break out of CFSCRIPT block.
>
>How many variables can I return with a CFSCRIPT block?
>
>T
>
>
__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread S . Isaac Dealey

> 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"; 
myreturn.world = "world"; 
return myreturn; 
}

Isaac 
www.turnkey.to 
954-776-0046

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread S . Isaac Dealey

> 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 wanted:
>
> Grab the digits up to the first / and put in day, month or year, depending
> on mask. Repeat for up to send /, and finally for last piece of data.
>
> Now if there aren't enough slashes or if the day or month isn't legal, I'd
> like to display and error and drop out of the cfscript block without
> converting to ODBC date.
>
> I used to do this in straight CF code and used a javascript pop up to
> display the error.

Are you checking the mask due to the possibility of the day and month being inverted ? 
i.e. mm/dd/ vs. dd/mm/? ... If so, you should be able to get away with no more 
than about 2 if's in a user-defined function... 

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,"/"); 
var year = listlast(mydate, "/"); 
tempdate = CreateDate(year,month,1); 
if (day gt daysinmonth(tempdate)) { return "Date exceeds days in month."; }
return CreateDate(year,month,day); 
}

then all you have to do is use the function: 

#validDate(form.mydate)#

and of course, IsDate(validDate(form.mydate)) will tell you if the validation result 
produced an error... 

hope this helps, 

Isaac
www.turnkey.to
954-776-0046
__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Thane Sherrington

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, the given
>mask doesn't matter if you use the CreateODBCDate function.

I may well be reinventing the wheel. :)  I do that all the time.  But my 
problem is I get customers who want mm/dd/ and others who want 
dd/mm/ and the eurodate validation doesn't always work (the day and 
month get swapped.)  So I wrote a basic CF program to handle this, but if I 
can do it as a UDF it would be much slicker (and give me some practice 
creating UDFs.)  Perhaps it is impossible to break out of CFSCRIPT block.

How many variables can I return with a CFSCRIPT block?

T

__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Jeffry Houser

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 no end
>of problems with the date parsing side of CFINPUT so I'm figured I'd do it
>myself.)

  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, the given 
mask doesn't matter if you use the CreateODBCDate function.


--
Jeffry Houser | mailto:[EMAIL PROTECTED]
Need a Web Developer?  Contact me!
AIM: Reboog711  | Phone: 1-203-379-0773
--
My CFMX Book: 

My Books: http://www.instantcoldfusion.com
My Band: http://www.farcryfly.com 

__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Thane Sherrington

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 of CFINPUT so I'm figured I'd do it 
myself.)

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 wanted:

Grab the digits up to the first / and put in day, month or year, depending 
on mask.
Repeat for up to send /, and finally for last piece of data.

Now if there aren't enough slashes or if the day or month isn't legal, I'd 
like to display and error and drop out of the cfscript block without 
converting to ODBC date.

I used to do this in straight CF code and used a javascript pop up to 
display the error.

T

__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Jeffry Houser

  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 to write a UDF?  You can also check out cflib.org 
for tons of existing User Defined Functions.
  I'm not sure what makes a variable "good" in this case, but if you offer 
more information, perhaps I can offer more information.



At 01:11 PM 6/27/2002 -0300, 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
>break out with an error message.  Other than nesting a lot of ifs, I can't
>figure out how to do it.
>
>T
>
>
__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: CFSCRIPT help

2002-06-27 Thread Michael Dinowitz

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 
>break out with an error message.  Other than nesting a lot of ifs, I can't 
>figure out how to do it.
>
>T
>
>
__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



CFSCRIPT help

2002-06-27 Thread Thane Sherrington

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 
figure out how to do it.

T

__
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: The mysterious CFSCRIPT...... Help

2001-01-08 Thread Robert Everland III

cfscript is like a dumbed down version of JavaScript, very limited cf in it,
it is good for where you would normally do a lot of cfsets or where there is
huge conditional logic because I have found cfscript throws no whitespace.
An example of cfscript would be something  like this


hey

hola

if (this is that)
{
writeoutput("hey");
}
else
{
writeoutput("hola");
}


There is a lot of documentation on cfscript under the loaded documentation,
it's chapter 20 under Developing Web Applications with ColdFusion


Bob Everland

-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 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 examples. I've seen some conversions
from ASP to CFSCRIPT...

Ideas and Suggestions are GREATLY appreciated.

Jeff
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: The mysterious CFSCRIPT...... Help

2001-01-08 Thread Park, Simon

If you get Ben Forta's Advanced ColdFusion Development book, he has a whole
chapter on CFSCRIPT.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Simon Park  Computer Systems Management, Inc.
Ph: 703-823-4300 x119   205 South Whiting Street #201
fax: 703-823-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 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 examples. I've seen 
> some conversions
> from ASP to CFSCRIPT...
> 
> Ideas and Suggestions are GREATLY appreciated.

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: The mysterious CFSCRIPT...... Help

2001-01-08 Thread Michael Dinowitz

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 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 examples. I've seen some conversions
> from ASP to CFSCRIPT...
>
> Ideas and Suggestions are GREATLY appreciated.
>
> Jeff
>
>
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



The mysterious CFSCRIPT...... Help

2001-01-08 Thread Jeff W

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 examples. I've seen some conversions
from ASP to CFSCRIPT...

Ideas and Suggestions are GREATLY appreciated.

Jeff




~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists