<%@Language="vbscript"%> [an error occurred while processing this directive] My Personal Page
Site hosted by Angelfire.com: Build your free website today!
  
 MY FAVORITES
 
ASP
 
 
 
 

 ADVERTISEMENT

I Love Maui,Aubrey & Diana

Me Seriously

This is Me

4. ColdFusion Foundations Variables ColdFusion Variable Types A variable is a named location in memory that holds a value. The "type" of variable refers to the type of data stored at that memory location. Some languages strongly resist converting numbers to strings (text) values and vice-versa; these languages are referred to as "strongly typed." ColdFusion is a "loosely typed" programming language. This means that variables are not (generally speaking) strongly associated with one data type or another; for example, a variable assigned a numeric value can be used as if it were a string variable. The length of text variables need not be defined before use, and I've created string variables several megabytes in length. The basic data types in ColdFusion (not that it's really all that important) are Numeric, String, Date/Time, and Boolean. There are others data types: arrays can be created; SQL queries, once executed, become a type of array; and structures were added in version 4.0. A List is almost another data type is ColdFusion, but it is actually just a string with some sort of delimiter, usually a comma. Special variables cannot be automatically converted to other types. A string can only be converted to a numeric if it looks like a number. "45.3" can be converted; "two" cannot be converted. Any number can be converted to a string. The two basic Boolean values are TRUE and FALSE; however YES and NO work well too. Non-zero numbers are considered TRUE; zero is considered FALSE. String values other than true, false, yes, no, or something easily converted to numeric, will cause an error to be displayed. Variables names are NOT case-sensitive, must start with a letter, and can include letters, numbers, and underscores ("_"). "Customer_Name" is valid; "2Customer" and "Customer Name" are not valid variable names. The value of a variable is displayed by expressing the variable in pound signs, within a CFOUTPUT block: Welcome to our online system, #Customer_Name#! All variable names that contain a single value exist in "variable scopes." (More about that in the next section.)