January 31, 2002
ColdFusion lists may not be the most efficient form of data storage, but they are convenient and thus very valuable. There are several ways to access lists and list members, including searching lists for values. And when searching there are two distinct forms of search supported. Use ListFind() and...
January 30, 2002
ColdFusion provides two functions named ArrayToList() and ListToArray() which can be used to convert data between lists and arrays. But, keep in mind that these functions will only support single dimensional arrays, as multi-dimensional arrays cannot be represented in list format. (Applies to:...
January 29, 2002
Need to find out how often a particular string occurs within a list? Use the ListValueCount() and ListValueCountNoCase() functions. And as these functions take an optional delimiter (the default is a comma) they can be used to find words in blocks of text too. (Applies to: ColdFusion 4 or later)
January 28, 2002
Structures are special ColdFusion data types which may contain one or more other variables (simple variables, lists, arrays, and even other structures). To obtain a list of the members within a structure use the StructKeyList() function, or use StructKeyArray() to obtain the member list as an...
January 27, 2002
Lists of strings should usually be delimited by commas with each value enclosed within quotes (in case there are spaces or other non-alpha characters within them). To convert simple lists (for example, a list returned by a FORM submission) to this format use the CFML ListQualify() function which...
January 26, 2002
CFML has no Odd() or Even() function (although you could write your own as UDF's). To determine if a number is odd or even simply use the MOD operator to divide it by 2 - if the remainder is 1 it is odd, if 0 it is even. (Applies to: ColdFusion All)
January 25, 2002
If you ever need to embed a time value within an HTTP header (perhaps using the tag) you must make sure that the time value is formatted correctly (according to RFC 1123). The simplest way to do this is to use the GetHttpTimeString() function - pass it a date/time, and it'll return a properly...
January 24, 2002
Temporary files are often needed during application processing, and in a multi-request environment (like ColdFusion) care must be taken to ensure that these file names are unique. As such, the CFML GetTempFile() function should be used. It takes the name of a directory (which should usually be...
January 23, 2002
Need to create temporary files during application processing? The ideal location for these files is in one of the directories designated by the operating system for just this purpose, and the CFML GetTempDirectory() function can be used to determine that directory. (Applies to: ColdFusion All)
January 22, 2002
has several uses, one of which is allowing the use of , and other Java applet based form controls. If the applets were installed along with ColdFusion using default settings then should automatically be able to embed the correct paths in the generated browser code. But if this is not the case, or...