COLD FUSION
Creates server side web applications very quickly.
Contains less code when compared to other language.
Contains Cold fusion server, Cold fusion templates which you write cold fusion mark up language.
What Can cold fusion do?
Enables to do large complex and dynamic websites.
Used in both development and maintenance.
Downloading and installing Cold fusion:
Sign into adobe account.
Variable:
Left side of the statement contains variable name.
And the right side contains value.
Variable must start with letter.
Cfset:
Used to set a value to a variable.
If variable does not exists it creates and assigns a value to variable.
Data types:
Used to contain value of particular type.
String/Numbers:
<cfset a="Hi"/>
<cfset a=12/>
Dates:
Gets the current date.
<cfset date=now()/>
Assigning a date.
<cfset date="1/1/2017" />
Arrays:
<Cfset arr="['hi','hello']" />
Structs:
Collection of data stored by a key and value.
<cfset a={"app"="1"} />
Hello world program:
Conditional Statements:
Checks the condition and prints statement.
If:
Checks the condition and prints the statement.
Syntax:
<cfif condition>
//Statement
</cfif>
Example:
If-else:
Syntax:
<cfif condition>
//Statement
<cfelse>
//Statement
</cfif>
Example:
Switch:
Syntax:
<cfswitch="expression">
<cfcase="value">
//Statement
</cfcase>
</cfswitch>
Example:
Loop:
Block of code that executes specified no of times.
Index loop:
Index attribute holds the counter it starts with value from attribute and is incremented for each iteration.
Conditional loop:
Checks whether condition is true.
List loop:
Delimiter attribute is used to separate the which characters are used as separators.
Function:
Self contained block of code that performs a function that returns a value.
Syntax:
Function-name(Parameter 1, parameter 2, .....)
Mathematical functions:
Abs: Absolute value i.e Abs(-4.3) = 4.3.
ArrayAvg: Average of array.
ArraySum: Sum of array.
Max: maximum value of given no.
Min: Minimum value of given no.
Round: Return the round of value.
File Writing:
File Reading:
Concatenation of String:
Sub-string:
Starting index:
User name and age:
First non repeated character:
Highest repeated character:
Digit identification of string:
Pyramid:
Sum of no from string:
Graphics:
Database Connection: