Functions Turn Input into Output


Think about the CFML functions you already know. Almost all of them accept at least one piece of information, do something with the information internally, and then return some kind of result. For instance, ColdFusion's uCase() function accepts one piece of information (a string), performs an action (converts it to uppercase), then returns a result.

So you can think of most functions as being like little engines, or mechanisms on an assembly line. Some functions accept more than one piece of information (more than one argument), but the point is still the same: almost all functions are about accepting input and creating some kind of corresponding output. A function's arguments provide the input, and its output is passed back as the function's return value.

As the designer of your own functions, you get to specify the input by declaring one or more arguments. You also get to pass back whatever return value you wish.



Macromedia Coldfusion MX 7 Web Application Construction Kit
Macromedia Coldfusion MX 7 Web Application Construction Kit
ISBN: 321223675
EAN: N/A
Year: 2006
Pages: 282

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net