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...
January 21, 2002
Generally, if a SQL statement attempts to save more data then is allowed by a column's width, that data will be truncated. If you'd rather not write the data at all if it will not fit, use and specify the maximum allowed length in the MAXLENGTH attribute. This way an error will be thrown and the...
January 20, 2002
is used to create bind parameters in ColdFusion SQL statements. For to work the DBMS and drivers must support this feature (most good DBMS's, including SQL Server and Oracle, do). ColdFusion will try to automatically detect their support and degrade the query as necessary. But as a rule you should...
January 19, 2002
is used to define bind parameters, allowing for faster (and more secure) SQL statement execution. When using make sure to explicitly provide the data type, and do not rely on the default value (string). (Applies to: ColdFusion 4.5 or later)
January 18, 2002
is used to perform server-side HTTP operations, retrieving data from other servers. can retrieve any data - text or binary. But be careful when requesting binary data (like graphics), these should not be accessed as variables using CFHTTP.FileContent, but should be written to file using the PATH...
January 17, 2002
The CFML SetVariable() function can be used to set variables, even variable names constructed dynamically - for example, if i were 2, SetVariable("item" & i, 10) would set variable item2 to 10. But in newer versions of ColdFusion this function is not needed, can do the same thing and do it...