Errata

Programming ColdFusion

Errata for Programming ColdFusion

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 38
3rd paragraph

Text reads thusly, "The footer file is even simpler. If contains a copyright notice
to display at the end of each template that calls it."

It should read as such, "It contains...."

Anonymous   
Printed Page 47
Example 3.7 reads Department: #Form.Name# it should be: Department

#Form.Department#

Anonymous   
Printed Page 47
2nd paragraph

The first sentence reads "...the template in Example 3-8 outputs the contents..."
That should be Example 3-7.

Anonymous   
Printed Page 48
3rd paragraph"

in the example, the second and the third input tags are identical. For the example to
work, its name should be DELETE instead of EDIT....

Anonymous   
Printed Page 72
second set of example code

The example to "select specific fields from a table where a certain field must meet a specific condition" is written in the book as follows.

SELECT Field1, Field2
FROM TableName
WHERE Field = value

My question, is how does this function? What is Field? Should Field have been Field1 or Field2? Or does it somehow match value to both Field1 & Field2. I'm confused.

Anonymous   
Printed Page 144
First mention of the ArrayPrepend() function

First mention of the ArrayPrepend() function is misspelled as ArrayPrenend()

Anonymous   
Printed Page 153
2nd paragraph

The example for QueryNew requires quotes around the value of the argument. The
example should read

<CFSET Products = QueryNew("ProductName, Color, Price, Qty")>

In Example 6-10 (in the middle of the page), QueryNew is correctly used.

Anonymous   
Printed Page 163
3rd paragraph

"complimentary" should be "complementary"

Anonymous   
Printed Page 166
2nd paragraph

The book states "This option should be used when writing data to persistent variables, as the case with the
second CFLOCK tag in our example".

However, the second CFLOCK tag is

<CFLOCK SCOPE="Session" TYPE="ReadOnly" TIMEOUT="30" THROWONTIMEOUT="Yes">
<CFOUTPUT>
Username: #Session.Username#<BR>
Access Level: #Session.AccessLevel#
</CFOUTPUT>
</CFLOCK>

This does not write data to persistent variables, it reads it. Perhaps the text in the second paragraph should read "as the case with the FIRST CFLOCK tag in our example"

Anonymous   
Printed Page 168
3rd code example

The third code example, which describes a method reducing the need for exclusive <CFLOCK> usage, will cause a "white-screen-of-death" error as written. The example is missing an isDefined() function call.

A corrected version of the example:

<cflock type="READONLY" timeout="30" scope="APPLICATION">
<cfif isdefined("application.init")>
<cfset request.init = application.init>
</cfif>
</cflock>

<cfif not isDefined("request.init")>
<cflock type="EXCLUSIVE" timeout="30" scope="APPLICATION">
<cfset application.init = 1>
<cfset application.foo = "bar">
</cflock>
</cfif>

Anonymous   
Printed Page 183
Halfway down page

"The SESSIONTIMEOUT attribute sets the timeout for any application variables..."
should be "The SESSIONTIMEOUT attribute sets the timeout for any session
variables..."

Anonymous   
Printed Page 230
4th paragraph, beginning "The function returns TRUE..."

The last line reads "Action is required for all resource types except Compontent...".

'Compontent' should be 'Component'.

Anonymous   
Printed Page 240
Example 9-2

In the explanation of this code, it mentions using both the StructKeyArray() function
and the IsSimpleValue() function. However, they are nowhere in the code and, having
never used either of them, I can't even guess where they would belong.

Anonymous   
Printed Page 269
Halfway down page

"THREADID accepts a Yes/No...." should be "THREAD accepts a Yes/No...."

Anonymous   
Printed Page 289
Halfway down page

"In Example 10-8" should be "In Example 10-9"

Anonymous   
Printed Page 292
1st paragraph

"The SELECT attribute indicates whether or not to display the column in the grid"
should be "The DISPLAY attribute indicates whether or not to display the column in
the grid"

Anonymous   
Printed Page 318
2nd paragraph

"This done using a new attribute called PATTERN" should be "This is done using a new
attribute called PATTERN"

Anonymous   
Printed Page 337
Example 11-4 - Line 21

At line 21 the following code exists in the example:

<cfif Column gt (OddColumns + 1)>
<cfset LeftOverIncrement = IncrementValue(LeftOverIncrement)>
</cfif>

This generates an error is the number of records is even as the LeftOverIncrement
variables doesn't exist.

the following works for a 44 record output across 4 columns:

<cfif Column gt (OddColumns + 1)>
<cfset LeftOverIncrement = IncrementValue(LeftOverIncrement)>
<cfelse>
<cfset LeftOverIncrement = "0">
</cfif>

Anonymous   
Printed Page 353
Bottom half of page

"Note that the variable name in the VALUE attribute of the OPTION tag is enclosed in
a set of single quotes"
Well, it isn't!

In addition, on page 355 (halfway down) it states "...we have to use the
PreserveSingleQuotes() function to keep the single quotes around the values we passed
in..."
There is no mention of the PreserveSingleQuotes function in the code at all!

Anonymous   
Printed Page 358
Top of page

Shouldn't the query name be something like "RemoveDateHired" rather than
"AddDateHired" ?

Anonymous   
Printed Page 412
Bottom of page

Starting from the sentence "TRANSFERMODE specifies the FTP transfer mode to use when
retrieving the file from the FTP server", the rest of the paragraph (and then entire
next paragraph) is talking about DOWNLOADING files, whereas it should be talking
about UPLOADING files.

Anonymous   
Printed Page 416
2nd paragraph

"This is accomplished by setting the ACTION attribute to Delete" should be "This is
accomplished by setting the ACTION attribute to Remove"

Anonymous   
Printed Page 472
3rd paragraph

"In our example, we set the FILTER attribute so that only entries having a surname
(sn) beginning with smi ..." should be "In our example, we set the FILTER attribute
so that only entries having a surname (sn) beginning with s ..."

Anonymous   
Printed Page 476
Top part of code

ATTRIBUTES="dn,cn,sn.givenName" should be ATTRIBUTES="dn,cn,sn,givenName"

Anonymous   
Printed Page 479
3rd paragraph

"The USERNAME attribute specifies the common name (cn) of a user with authority to
delete entries" should be "The USERNAME attribute specifies the common name (cn) of a
user with authority to add entries"

Anonymous   
Printed Page 482
2nd paragraph

"Deleteand" should be "Delete and"

Anonymous   
Printed Page 482
Code

USERNAME="cn=Directory Manager" should be USERNAME="Directory Manager"

Anonymous   
Printed Page 509
Bottom paragraph

"The complement value is arrived at by subtracting 1 from the matched record's
original score" should be "The complement value is arrived at by subtracting the
matched record's original score from 1"

Anonymous   
Printed Page 509
NEAR/N section

fish<NEARN/10>carp<NEARN/10>bass<NEARN/10> should be
fish<NEAR/10>carp<NEAR/10>bass<NEAR/10>

I'm not even sure the last <NEAR/10> needs to be there.

Anonymous   
Printed Page 528
IsNumric(... should be IsNumeric(...

Anonymous   
Printed Page 529
Bottom of page

REFind("abcdefg", "a")
should be
REFind("a", "abcdefg")

likewise,

REFind("Watch the candle burn", "can")
should be
REFind("can", "Watch the candle burn")

Anonymous   
Printed Page 530
first paragraph

Text reads: "individual characters in this manor"
Should read: "individual characters in this manner"

Anonymous   
Printed Page 530
last paragraph: The dollar sign matches a newline

character...

According to J.Friedl's "Mastering Regular Expressions" (O'Reilly), "The caret
and dollar are particular in that they match a position in the line
rather than any actual text characters themselves" (page 8)

Anonymous   
Printed Page 530
last paragraph: In order for the dollar sign to work within

a set, it must be used as the last character in the set or range of
characters...

AFAIR dollar sign is treated literally in character classes (author
calls them "sets"). Unfortunately I cannot find explicit quote in
Friedl's book. Ask him :)

Anonymous   
Printed Page 531
second paragraph:Likewise, searching for "[ab]?c" matches

"c" as well as "abc"

should be:

Likewise, searching for "[ab]?c" matches "c" as well as "ac"

*** [ab]?c will NOT match abc, because [ab] matches only ONE
character.

Anonymous   
Printed Page 532
Last paragraph

<CFSET NewString = REReplace("T8h3i53s 8a3 t3e2s9t.", "[[:digit:]]", "", "ALL")>

The text says that this line of code will output "This is a test." However, it only
outputs "This a test."

Anonymous   
Printed Page 533
Bottom of page

"REFind() performs a case-insensitive search; REFindNoCase() performs a case-
sensitive search."
The author has got these the wrong way around!

Anonymous   
Printed Page 534
Halfway down page

"In it's basic form" should be "In its basic form"

Anonymous   
Printed Page 537
First Paragraph

The default for the SCOPE parameter on all REPLACE functions is "ONE" not "ALL" as stated here.

Anonymous   
Printed Page 539
Whole page

All of these should be checked.
I definitely know that the first one is wrong, because it is missing the necessary
third argument (the argument that substitutes in place of the regular expression).
Some of the others look highly suspect.

Anonymous   
Printed Page 539
Bottom of page

It should be noted that by splitting up the input file, not all of the possible
matches will be found. For example, if you are replacing all HTML tags and your file
split occurs right in the middle of a <head> tag, then that tag will not be removed.

Anonymous   
Printed Page 569
Second paragraph after "Calling Custom Tags" heading

The book suggests naming a custom tag <CF_MyTag> "MyTag.cfm". On my copy of
CF5/Linux, the custom tag needs to be named "mytag.cfm" UNLESS it is in a registered
Custom Tags directory.

Anonymous   
Printed Page 575
10th line of Example 19-5 on page 575

"Session.SessionVariable" is misspelled.

<CFSET Session.SesssionVariable = "I am a Session variable">

should be

<CFSET Session.SessionVariable = "I am a Session variable">

Anonymous   
Printed Page 587
first paragraph

"he" should be "the" in sentence "Range is calculated by subtracting he MinValue ..."

Anonymous   
Printed Page 614
2nd paragraph

"... using the Increment() function" should be "... using the IncrementValue()
function"

Anonymous   
Printed Page 653
last paragraph, in parentheses

"be" should be "by"

Anonymous   
Printed Page 654
top sentence in example url

http://wwwopenwddx.org is missing a period after www.

Anonymous   
Printed Page 670
last sentence

extraneous ")" in the sentence beginning "Possibilities..."

Anonymous   
Printed Page 677
Code

The comment <!--- output the refresh interval in minutes ---> appears to be in the
wrong place.

Anonymous   
Printed Page 700
1st paragraph

"The parameter contains the value "Hello World!" should be "The parameter contains
the value "Hello World"

Anonymous   
Printed Page 706
Code at top

The attribute URL="24-4.cfm" should read URL="24-4.cfm?Department="

Anonymous   
Printed Page 707
Bottom half of page

"The VALUELOCATON attribute is optional" should be "The VALUELOCATION attribute is
optional"

Anonymous   
Printed Page 754
4th entry under "Attributes" for CFINPUT

The description for the SIZE attribute says "Ignored if ACTION is Checkbox or Radio";
this should be "...if TYPE is Checkbox or Radio".

Anonymous   
Printed Page 793
2nd line below "CFTEXTINPUT" header

The example at the top of the page shows a CFSLIDER tag within the CFFORM tags.
Instead of CFSLIDER, that tag should be CFTEXTINPUT.

Anonymous   
Printed Page 807
In the section "Decision/Evaluate Functions", second column, fourth entry

The fourth entry is "IsAthenticated()". This should be "IsAuthenticated()">

Anonymous   
Printed Page 833
DatePart Description

It appears that part of the description for DatePart was coppied and pasted from
DateDiff. Because of that, the final line which says "If date1 is greater than
date2, a negative number is returned" is not applicable.

Anonymous   
Printed Page 843
"GetDirectoryFromPath" section

The example for GetDirectoryFromPath() uses the function GetTemplatePath() as its
argument. But GetTemplatePath is deprecated as of ColdFusion 4.0 (see page 848). The
example should be changed to use GetBaseTemplatePath(), as in

<cfoutput>This directory is: #GetDirectoryFromPath(GetBaseTemplatePath())#</cfoutput>

Anonymous