Following are some tips regarding the release 4.0 of ColdFusion, released in late 1998. These cover both the application server and Studio.

Please be aware that these were offered primarily to assist users of 3.1 and previous releases making the migration.

Users who have only started using ColdFusion since release 4.0 will still find a couple of tips useful.

ColdFusion 4.0 Tips:

(Sep 1998-Dec 1998)

Some of the syntax that's no longer valid

Posted: 12/22/98

We mention below how CF4 implements stronger syntax checking that will cause some legacy code to fail, even if strict validation is turned off. Here are some of the items we've found that will not work in CF4:

- CFEXIT cannot be within a CFOUTPUT block.
- If a CFOUTPUT references a CFQUERY (named, let's say, "chapter"), and both the CFQUERY and CFOUTPUT are executed within a CFLOOP on another query having a table with a column named "chapter", the CFOUTPUT will now fail reporting that there is no such query named "chapter", even if the CFQUERY is right before it. Such code would work fine in 3.1 but now fails with this error.


New SHOWDEBUGOUTPUT option on CFSETTING

Posted: 12/15/98

There is a new option in the CFSETTING tag, which previously allowed only ENABLECFOUTPUTONLY. Now, there is SHOWDEBUGOUTPUT, which can be used to surpress debugging info that would otherwise be shown after execution of a template.

Presumably, setting it to "yes" does not cause display of the debugging output if it's not been otherwise requested (as set in the admin or as set with the MODE=DEBUG url option or the CFQUERY DEBUG="YES" option.)

Also, while MODE=DEBUG can turn on debugging when it's not set in the administrator, and it does so without requiring a modification to code, this new feature does provide the opposite and still-needed feature of a way to turn off debugging when it has been turned on using just a URL option.


CFSELECT no longer requires "SIZE" parm. Defaults to 1.

Posted: 12/15/98

The CFSELECT tag, which can be used inside a CFFORM tag to help build a drop-down list from query data, previously required the specification of a SIZE parameter, even if the drop-down list did not allow multiple selections (in which case 1 should be implied, as it is in a normal HTML SELECT statement).

In Release 4, though the documentation says it's required, it is not, and it defaults to 1.


CFEXIT does not work as before, if in CFINCLUDEd template

Posted: 11/30/98

CFEXIT's functionality has changed quite a bit in CF4. It has new behaviors depending on use of a new parameter, called "method" whose values include "exittag", "exittemplate", and "loop". There are also changes in behavior depending on where the tag is used.

While in most cases, the new the behaviors remain unchanged if you do not use the new parameter, there is one case we've found where it basically no longer works at all. This has caused some significant and unexpected problems.

Normally CFEXIT works just like CFABORT, although the former is intended primarily for use within custom tags. It would normally terminate the execution of the template in which it is executed. But we have found that if it is called from within a CFINCLUDEd template, it no longer terminates the execution of the template that called it.

The solution is to change the CFEXIT to a CFABORT in any included templates where you expect it to terminate the calling template. Be forewarned.


Turning off "Strict Validation" option won't guarantee existing code will work in Release 4

Posted: 11/26/98

We were very surprised and dismayed to learn that code which worked fine in release 3/3.1 suddenly failed when the server was upgraded to release 4. The disappointment came from the fact that there is an option in the administrator to turn off "strict validation".

The assertion (as even mentioned in the release notes, at http://www.macromedia.com/v1/documents/cf4/allaire_support/releasenotes.cfm#valid) is that doing this would allow existing code to run in release 4.

But this has not proven true. We have found many existing templates suddenly failing in release 4, even though we have turned off the strict validation. It turns out that there are certain new syntax rules that will cause existing code to fail regardless of the "strict validation" setting.

This is terribly important for any site considering upgrading to release 4. It's imperative that you run all code through the provided "cfml syntax checker"(see the next tip below) which is provided in release 4. This tool can be reached from the main page of the CF4 online documentation, which will have been installed with release 4 of either Studio or the server.

You provide a local directory name and the tool runs through all the code and checks the syntax, reporting any violations. See the next tip, though, on how it reports only one error per template.


Syntax checker only reports FIRST error in a template

Posted: 11/26/98

Update (6/15/01):
This and the the two other tips on the syntax checker are from 1998 and refer to the initial release of the syntax checker. Some of the issues may no longer apply if you're running 4.01, 4.5, or 5.

In any case, there is now a much more elaborate tip on why the syntax checker is useful and, more important, how to find it.

The new CFML syntax checker included in release 4 allows you to validate if the code in your templates (or an entire directory tree of them) meets the new stricter validation of Release 4.

One shock we found is that the checker only reports the first error in each template, not all of them. So be warned: you must re-run the checker after fixing any errors, to see if more errors occur later in such "fixed" templates.


Some syntax checker quirks

Posted: 11/26/98

Update (6/15/01):
See the update in the tip above to learn more about the Syntax checker and where to find it.

In using the new Release 4 syntax checker, we have noticed a couple of quirks: if you specify a trailing slash on the path name you provide for locating templates to check, the checker will report that each file in the directory "cannot be found". The solution is to remove the trailing slash on the directory specification.

Also, while it allows you to enter a path in the form of "http://domain.com/directory", it will simply report all files as having no error. You must instead provide a "file system" directory specification, such as "c:/webshare/wwwroot/directory".


Listing all application/session variables

Posted: 9/16/98

Update (6/15/01):
See the update in the tip above to learn more about the Syntax checker and where to find it.

CF4 finally brings the ability to list all application or session variables. These values can be accessed using the new "collection" feature by way of using a CFLOOP over the collection called "#application#" or "#session#". For more info, see this discussion in the beta forum: http://betaprograms.macromedia.com/betaconf/Thread.cfm?&Thread_ID=58541&mc=4

Beware CTRL+SHIFT+R (Extended Search and Replace)

Posted: 9/15/98

If you were a frequent user of the Extended Search and Replace feature of Studio 3.1, be aware that this functionality has been split into an Extended Replace and a new separate Extended Find. This would be worth celebrating except that the old keystroke for the combined feature (CTRL+SHIFT+R) now calls up only the Replace feature. Not only might this confuse users of the old version, it also could cost them dearly if they're not paying attention and presume that the replace button will perform the find. If you put text in the find area and none in the replace area, and press "replace", you will convert all occurrences of the search text to null.

Of course, this is expected functionality if you're trying to do a replace. This is just a warning to those users who may call it up by accident intending to do a find and presume that it still does that. It does not. Use "extended find" instead (CTRL+SHIFT+F).

There are other beneficial improvements to both dialogues, including a new improved interface for selecting directories as well as a history list both for directories and searched text. Neat.

Tips Contents:

| Home | ColdFusion | Articles | Presentations
| User Groups | Other Resources | Press Releases | Company

© 1998-2024, Charles Arehart, SysteManage
Our Practice Makes You Perfect