Entries for month: April 2009

Check if a ColdFusion Array Position Exists

This is some sample script that I used today to check if a position in an array exists.  Basically, I was tasked with creating an email that showed hours from two separate datasources, and I needed to combine those side by side in an array to show the differences.  I knew that the first set of hours would always exist, so I looped over the second set of hours with a nested loop matching up the dates.  To check if the second position existed, I used a cfparam with set values of zero.  I did this because ColdFusion doesn't seem to have clean way of checking for a missing element.

Updating Datasource with ColdFusion Bean

John Gagliardi(cftips.net) and I have been working on a new flex application that will be used as a project tracker for work related purposes.  John is  building the Flex or UI side of the application, while I am building the database and ColdFusion backend.  We are trying to build the entire application using OOP design priciples; specifically MVC.  After building the database and basically getting a great start on the project, I am starting to realize how powerful OOP can actually be.  Today we created a task updater that is controlled by horizontal date slider, and I wanted to share some of my backend code which will hopefully show just how easy it is to update a simple CRUD app.