Interview for Variables and Conditions
      "Variables and Conditions" interview with Melissa Lizmi
Michael Smith: This time we are talking with Melissa Lizmi about her CFUNITED-05
talk "Variables and Conditions". So why should a developer come to your session Melissa ?

Melissa Lizmi: This session is ideal for those that are new to the CFML language or those that just
need a refresher.

We'll start by covering the simplest CF variables (page variables) and progress to the more complex
variable types such structures, arrays, and combination variables.  Then we will discuss how you can
program your application to make decisions; otherwise know as conditional processing or "if/then"
statements.  We'll also discuss a more efficient approach to lengthy if/then statements; the
CFSWITCH statement.

MS: So what exactly is a variable in ColdFusion?

ML: Variables in ColdFusion are much like variables in any other language, except that CF variables
are much easier to create and call.  

But if you want to know what variables are in general terms.  You can think of a variable as a box
that can hold a value.  We give the box a name so we can easily retrieve the value.  The value in
the box can remain constant or, as the name variable implies, it can change.

MS: So what kinds of things let you change a variable?

ML: Well, we can explicitly change the value of a variable with the  command.  Or we can use
variables to perform calculations, or values can change depending on which links our users click, or
what records are retrieved from our database.  There are many ways variable values can be changed.

MS: Why would I need more complex variable types in my applications?

ML: When we find ourselves using a lot of variables in an application it is often extremely helpful
to "group" related variables together. (That's all complex variables really are, just a way to
"group" related variables.)  Once we group variables, we can call and manipulate each group of
variables much greater ease than if we had created and named each variable independently.

MS: That makes sense - so what kinds of variable groups does Coldfusion have?

ML: Advanced variable types are lists, structures, arrays, combination variables (like an array of
structures), and COM (component object model) variables. 

MS: I see you are also covering conditionals - what are they exactly?

ML: Conditional processing gives your program the ability to make decisions.  Believe it or not,
with the help of some key commands, CFIF or CFSWITCH, your program can make decisions. We can use
the CFIF or CFSWITCH commands to code the possible conditions we might expect (like UserAge GTE 65),
then we can say (in code terms) if our condition evaluates true, we send the user to our retirement
page, or, if the condition evaluates false, we send the user to the employee page.
CF provides two main methods of implementing conditional processing.

	CFIF (CFIF/CFELSEIF/CFELSE) - basic if/elseif/else processing.
	CFSWITCH (CFSWITCH/CFCASE/CFDEFAULTCASE) - C-style switch or VB-style case commands.

MS: Sounds like a great session for beginners to CF. See you at CFUNITED!
Home  |  About  |  Topics  |  Speakers  |  Exhibitors  |  Register  |  News  |  Travel
© Copyright TeraTech Inc 2004. All rights Reserved.