Home
Username:
Password:
Adobe ColdFusion 8 Tutorials

Debugging/Troubleshooting / Preventing Problems




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

I want to give you some ideas on ways to prevent problems you can have with your code and this is just a nice little list for you to run through and refresh yourself on as you move forward with learning to code in ColdFusion. So, I'm just going to go right through this list with a few explanations. Always test if variables are defined before you try and use them. It's very important to do that. You will get an error every time if the variable is not defined. If you need to assign default values use CFPARAM to do so and then you can assign your default value and test to make sure it exists at the same time. If you use the Recordset Builder to build queries always click the Test button to test your output before you move into running the page. This can save you a lot of issues and, also double check and make sure that the correct information is coming out of the database. Use the Developmental Server for testing so you can turn on Debugging. Now, any web server allows you to turn on debugging so it really, the Developmental Server just makes it easier for installing the course, but with regard to turning on Debugging you simply need the ColdFusion Administrator, so I'll clarify number 4 just a little bit for you. View your SQL Statements being produced in the Debugger. If you're having issues and your query won't run, sometimes you cannot see that, but if you can double check your SQL Statements. Double check your code for errors after typing it out and before you run it. There are many, many times when I catch things so it's just a habit of mine to always double check it before I go to run it. When you do that, take time to look at your quotes, pound signs, brackets, other characters. Make sure that if you have one you have two in terms of quotes, pound signs, brackets, parentheses, et cetera. Also, be sure the Template has been uploaded if your page isn't running correctly. There are so many times in class where it's simply a matter of whoops, I forgot to upload the page. Now, throughout this course I avoided that issue by simply pulling in the root folder into Dreamweaver that we are actually using, which is residing directly on the ColdFusion Server. This is not how I normally operate. I normally have a separate folder on my hard drive and then I upload to the ColdFusion Server once the page has been tested. So, that is up to you, but I feel like it's much better if I have two copies instead of one. Use Browser Refresh. This is F5 on most browsers and that will allow you to refresh the page. Sometimes it's simply the browser is showing you the old page which is why your new corrections aren't working. Also, Preview Temporary File is a setting in Dreamweaver. We set the Preferences in Dreamweaver to turn off the Temporary Files. You'll find you'll have better luck with Dynamic Development if you turn that off. Number 11 I already mentioned, your testing server can act as a backup copy if you store another copy on your local drive. This does mean you have to put every page to that server, the ColdFusion Server, before previewing, but it does allow you to store two copies in case one has a few issues, let's just put it that way. The other thing you could do is put working code you use often into Snippets. There is a Snippets Panel in Dreamweaver that allows you to store code pieces as long as you have run this code you might just as well save some of it and if you create a folder within the Snippets area here - I'll show you, it's right over here next to the Files Panel - create a new folder by clicking this yellow folder. You can select pieces of code, click the Plus sign, give it a name and you can store it inside this Snippets area; that way, if you need a particular chunk of code to use over again you just drag it onto the page from here and you know that code is all correct. So, just another idea for preventing issues. If you know some code is running you might just as well save it so you can use that code as a starting point the next time and prevent some issues. So, just a few ideas in preventing problems in your code, whatever type of programming language you're working in and hopefully this list will assist you through the course.

Tutorial Information

Course: Adobe ColdFusion 8
Author: Candyce Mairs
SKU: 34093
ISBN: 1-936334-05-4
Release Date: 2010-02-26
Duration: 8 hrs / 112 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available