Re: CFParam vs. IsDefined

2010-09-04 Thread Scott Brady
On Wed, Sep 1, 2010 at 9:50 AM, Russ Michaels r...@michaels.me.uk wrote: defo better to make sure they are defined. Also using isDefined() is also bad as this search every single scope for your variable and is thus quite slow and can potentially cause timeouts. Much better to use

Re: CFParam vs. IsDefined

2010-09-04 Thread Scott Brady
in cfscript but not in cftags syntax. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Peter Boughton [mailto:bought...@gmail.com] Sent: Thursday, 2 September 2010 8:26 PM To: cf-talk Subject: Re: CFParam vs. IsDefined Hmmm, maybe they've changed

Re: CFParam vs. IsDefined

2010-09-02 Thread Peter Boughton
That coupled with StructKeyExists is a pain to type! Why on earth would you *type* it!? This is exactly why your IDE has Word Completion, Snippets and Templates! Str then Alt-/ completes word to StructKeyExists (press Alt-/ again to cycle through other commonly used words) ske then Ctrl-J

Re: CFParam vs. IsDefined

2010-09-02 Thread Peter Boughton
Oh, just to point out, ske and skel are custom ones I've created. They're not default commands. Shortcut keys may vary too. ~| Order the Adobe Coldfusion Anthology now!

RE: CFParam vs. IsDefined

2010-09-02 Thread Andrew Scott
This must be a CFEclipse thing as CFBuilder is CTRL-SPACE Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Peter Boughton [mailto:bought...@gmail.com] Sent: Thursday, 2 September 2010 7:01 PM To: cf-talk Subject: Re: CFParam vs. IsDefined

Re: CFParam vs. IsDefined

2010-09-02 Thread Peter Boughton
This must be a CFEclipse thing as CFBuilder is CTRL-SPACE That's code completion. Word completion is faster (when you know what you want). These are all Eclipse things (and will exist in any other IDE worth using), so available for both CFEclipse and CFBuilder.

RE: CFParam vs. IsDefined

2010-09-02 Thread Andrew Scott
: CFParam vs. IsDefined This must be a CFEclipse thing as CFBuilder is CTRL-SPACE That's code completion. Word completion is faster (when you know what you want). These are all Eclipse things (and will exist in any other IDE worth using), so available for both CFEclipse and CFBuilder

Re: CFParam vs. IsDefined

2010-09-02 Thread Michael Grant
I'm very interested. I just started using Aptana (coming from Homesite+) and I really really want to speed up my dev to where I was at with HS+. I'd love some more hotkey and snippet info. On Thu, Sep 2, 2010 at 5:00 AM, Peter Boughton bought...@gmail.com wrote: That coupled with

Re: CFParam vs. IsDefined

2010-09-02 Thread Peter Boughton
Hmmm, maybe they've changed the default. Goto WindowsPreferences and type keys in the filter box. That should bring the key binding panel, type word in that. Look for Word Completion option(s) and it'll list what the binding is. If it still doesn't work, check the When value - I've got one

RE: CFParam vs. IsDefined

2010-09-02 Thread Andrew Scott
Ok it works in cfscript but not in cftags syntax. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Peter Boughton [mailto:bought...@gmail.com] Sent: Thursday, 2 September 2010 8:26 PM To: cf-talk Subject: Re: CFParam vs. IsDefined Hmmm, maybe they've

Re: CFParam vs. IsDefined

2010-09-02 Thread Rick Root
On Thu, Sep 2, 2010 at 5:00 AM, Peter Boughton bought...@gmail.com wrote: That coupled with StructKeyExists is a pain to type! Why on earth would you *type* it!? vi doesn't do code completion? lol ~| Order the Adobe

Re: CFParam vs. IsDefined

2010-09-02 Thread Steve Lichtenberg
Yes it does :-). In .virc set up aliases for anuything you want. use them in update mode not insert mode. --S ^ On Thu, Sep 2, 2010 at 8:16 AM, Rick Root rick.r...@gmail.com wrote: On Thu, Sep 2, 2010 at 5:00 AM, Peter Boughton bought...@gmail.com wrote: That coupled with

Re: CFParam vs. IsDefined

2010-09-02 Thread Rick Root
On Thu, Sep 2, 2010 at 8:23 AM, Steve Lichtenberg steve.lichtenb...@gmail.com wrote: Yes it does :-).  In .virc set up aliases for anuything you want.  use them in update mode not insert mode. touche' ~| Order the Adobe

Re: CFParam vs. IsDefined

2010-09-02 Thread Claude Schnéegans
Also using isDefined() is also bad as this search every single scope for your variable CFPARAM will also search for the variable exactly the same way in order to create it if it does not exist. What's the big differrence? and can potentially cause timeouts. Wow! Where do you hide your

CFParam vs. IsDefined

2010-09-01 Thread Michael Grant
I prefer to CFParam my vars with a default value of a zero len string or a 0 for numeric values. Then I skip the isdefined and just test against the value. Well recently someone I know said that it's better to test if it's defined. Is there a pro or con to doing it my way vs. IsDefined ? Thanks.

RE: CFParam vs. IsDefined

2010-09-01 Thread DURETTE, STEVEN J (ATTASIAIT)
vs. IsDefined I prefer to CFParam my vars with a default value of a zero len string or a 0 for numeric values. Then I skip the isdefined and just test against the value. Well recently someone I know said that it's better to test if it's defined. Is there a pro or con to doing it my way vs

Re: CFParam vs. IsDefined

2010-09-01 Thread Dave Watts
I prefer to CFParam my vars with a default value of a zero len string or a 0 for numeric values. Then I skip the isdefined and just test against the value. Well recently someone I know said that it's better to test if it's defined. Is there a pro or con to doing it my way vs. IsDefined ? No,

Re: CFParam vs. IsDefined

2010-09-01 Thread Russ Michaels
it and it is there you should be ignoring it. Steve -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Wednesday, September 01, 2010 11:36 AM To: cf-talk Subject: CFParam vs. IsDefined I prefer to CFParam my vars with a default value of a zero len string or a 0

Re: CFParam vs. IsDefined

2010-09-01 Thread John M Bliss
. If it isn't there then something went wrong. And if you didn't define it and it is there you should be ignoring it. Steve -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Wednesday, September 01, 2010 11:36 AM To: cf-talk Subject: CFParam vs. IsDefined

RE: CFParam vs. IsDefined

2010-09-01 Thread Mark A. Kruger
- From: Russ Michaels [mailto:r...@michaels.me.uk] Sent: Wednesday, September 01, 2010 10:51 AM To: cf-talk Subject: Re: CFParam vs. IsDefined defo better to make sure they are defined. Also using isDefined() is also bad as this search every single scope for your variable and is thus quite slow

Re: CFParam vs. IsDefined

2010-09-01 Thread Russ Michaels
-talk Subject: Re: CFParam vs. IsDefined defo better to make sure they are defined. Also using isDefined() is also bad as this search every single scope for your variable and is thus quite slow and can potentially cause timeouts. Much better to use StructKeyExists() and only test the scope

RE: CFParam vs. IsDefined

2010-09-01 Thread Andy Matthews
. Admittedly we could probably do this more efficiently by having all perms as keys inside a perms struct, but cest la vie. andy -Original Message- From: Russ Michaels [mailto:r...@michaels.me.uk] Sent: Wednesday, September 01, 2010 10:51 AM To: cf-talk Subject: Re: CFParam vs. IsDefined

Re: CFParam vs. IsDefined

2010-09-01 Thread John M Bliss
: CFParam vs. IsDefined defo better to make sure they are defined. Also using isDefined() is also bad as this search every single scope for your variable and is thus quite slow and can potentially cause timeouts. Much better to use StructKeyExists() and only test the scope your variable

Re: CFParam vs. IsDefined

2010-09-01 Thread Sean Corfield
On Wed, Sep 1, 2010 at 8:54 AM, John M Bliss bliss.j...@gmail.com wrote: cfloop index=i from=1 to=1 cfif not IsDefined(variables.anothervar i) cfset SetVariable(variables.anothervar i, i) /cfif /cfloop Try that with cfset variables[anothervar i] = i / - I suspect setVariable() is

Re: CFParam vs. IsDefined

2010-09-01 Thread John M Bliss
Michaels [mailto:r...@michaels.me.uk] Sent: Wednesday, September 01, 2010 10:51 AM To: cf-talk Subject: Re: CFParam vs. IsDefined defo better to make sure they are defined. Also using isDefined() is also bad as this search every single scope for your variable and is thus quite slow

Re: CFParam vs. IsDefined

2010-09-01 Thread Roger Austin
Michael Grant mgr...@modus.bz wrote: I prefer to CFParam my vars with a default value of a zero len string or a 0 for numeric values. Then I skip the isdefined and just test against the value. Well recently someone I know said that it's better to test if it's defined. Is there a pro

Re: CFParam vs. IsDefined

2010-09-01 Thread Russ Michaels
Skype: markakruger www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Russ Michaels [mailto:r...@michaels.me.uk] Sent: Wednesday, September 01, 2010 10:51 AM To: cf-talk Subject: Re: CFParam vs. IsDefined defo better

Re: CFParam vs. IsDefined

2010-09-01 Thread Peter Boughton
I prefer to CFParam my vars with a default value of a zero len string or a 0 for numeric values. Then I skip the isdefined and just test against the value. Well recently someone I know said that it's better to test if it's defined. Is there a pro or con to doing it my way vs. IsDefined ? There

Re: CFParam vs. IsDefined

2010-09-01 Thread David McGraw
The only general advantage I see is that you are reserving memory no matter what, even though it's not much, where as with the isDefined, your just checking, rather than reserving that memory. I prefer to CFParam my vars with a default value of a zero len string or a 0 for numeric values.

Re: CFParam vs. IsDefined

2010-09-01 Thread Rick Root
Personally I like to cfparam things that I know are supposed to exist, and I will go both ways on page variables that may or may not exist. I prefer to param it and then test for a valid value than to test for isDefined() Ie... cfparam name=someid default= cfif someid eq (or cfif len(someid)

Re: CFParam vs. IsDefined

2010-09-01 Thread Casey Dougall
On Wed, Sep 1, 2010 at 5:56 PM, Rick Root rick.r...@gmail.com wrote: Personally I like to cfparam things that I know are supposed to exist, and I will go both ways on page variables that may or may not exist. I prefer to param it and then test for a valid value than to test for

Re: CFParam vs. IsDefined

2010-09-01 Thread Tony Bentley
A classic issue yesterday related to isDefined(): This worked perfectly: cfscript //pass boolean to determine if the given field is null in the stored proc (1=submitted, 2=finalized) if(arguments.status eq 1){ submitted = false;