1) structKeyExists() - I use this to check the URL scope for the 'mo' and
'yr' variables. It's really the same as <cfif isDefined('URL.mo')> (or in
cfscript if (isDefined('URL.mo')) { do something here }. Arguably, it's a
little bit faster to use the structKeyExists() function. I believe the
rationale was that it's just checking a structure for the existence of a
key, whereas isDefined() actually has to parse a string (the argument),
which is relatively slow.
2) writeOutput() is the same as document.write() in JS. it simply writes
output to the screen. Honestly, I don't know how 'correct' my usage of it
was in the calendar. My goal in the calendar wasn't necessarily to go for a
best practice approach...but rather a "can I build a calender in 100%
cfscript" approach.
3) the 'variables' scope is just the local scope. <cfset myVar = "foo"> is
the same as <cfset variables.myVar = "foo">. The latter is just more
explicit, which would prevent any scope hunting as well as making the code
a bit more readable/self-documenting.
4) noted : )
Glad you were able to put the code to use.
Charlie
----- Original Message -----
From: "daniel kessler" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, May 14, 2004 6:47 AM
Subject: Re: days of the month
> Thanks to everyone who replied. I learned alot looking these over. I
ended up using Charlies. It's really nice looking and easily modified.
> I had a couple of questions and comments about it.
>
> - it uses structKeyExists. I'm unfamilar with the term struct. Does that
indicate a complex data type, like an object?
>
> - I hadn't seen 'writeOutput()' before. I guess that's only for in-line
cfscripts. I hadn't seen those before either. It looks nice without all the
cfifs and just ifs.
>
> - Is the var variables a cf owned (built-in) term or is it just a var that
you created here? I don't see it defined before it has attributes added (ie
variables.current_date).
>
> - I had some trouble grabbing the code off the web page. DW ignored all
the spaces and it became one long sentence. I then tried to reformat it,
causing some problems. I'm not complaining cause it saved me a bunch of
time and looks really cool, but it might be nice to offer it as a linked,
file download.
>
> Again, thanks for all the replies and the great calendar.
>
> >I'm writing an event calendar:
> >http://hhp.umd.edu/HHPv1/hhp_index.cfm
> >
> >I need to determine the day numbering. It would seem that I need the
> >number of days in the month and the DAY that 'day1' begins on (thurs,
> >fri, etc.) so I can fill the predecessors with blanks. I'll also
> >need to determine this for future/other months.
> >I guess I'll need to determine the DAY for each date too, so I can
> >designate them with a 'weekend' color.
> >
> >Are there possibly general calendar tutorials that would use the same
> >information?
> >
> >Am I missing anything else?
> >
> >
> >thanks.
> >
> >--
> >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
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

