<CF Comment><!--- ColdFusion Sample File ---></CF Comment><br/>
<CF Comment><!--- Source: https://helpx.adobe.com/coldfusion/developing-applications/the-cfml-programming-language/using-arrays-and-structures/structure-examples.html ---></CF Comment><br/>
<Normal Text></Normal Text><br/>
<Tags><head></Tags><br/>
<Tags><title></Tags><Normal Text>Add New Employees</Normal Text><Tags></title></Tags><br/>
<Tags></head></Tags><br/>
<Normal Text></Normal Text><br/>
<Tags><body></Tags><br/>
<Tags><h1></Tags><Normal Text>Add New Employees</Normal Text><Tags></h1></Tags><br/>
<CF Comment><!--- Action page code for the form at the bottom of this page. ---></CF Comment><br/>
<Normal Text></Normal Text><br/>
<CF Comment><!--- Establish parameters for first time through ---></CF Comment><br/>
<CF Tags><cfparam</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"Form.firstname"</Attribute Values><Tag Attributes> default</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>""</Attribute Values><CF Tags>></CF Tags><br/>
<CF Tags><cfparam</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"Form.lastname"</Attribute Values><Tag Attributes> default</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>""</Attribute Values><CF Tags>></CF Tags><br/>
<CF Tags><cfparam</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"Form.email"</Attribute Values><Tag Attributes> default</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>""</Attribute Values><CF Tags>></CF Tags><br/>
<CF Tags><cfparam</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"Form.phone"</Attribute Values><Tag Attributes> default</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>""</Attribute Values><CF Tags>></CF Tags><br/>
<CF Tags><cfparam</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"Form.department"</Attribute Values><Tag Attributes> default</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>""</Attribute Values><CF Tags>></CF Tags><br/>
<Normal Text></Normal Text><br/>
<CF Comment><!--- If at least the firstname form field is passed, create</CF Comment><br/>
<CF Comment>a structure named employee and add values. ---></CF Comment><br/>
<CF Tags><cfif #Form.firstname# eq </CF Tags><Attribute Values>""</Attribute Values><CF Tags>></CF Tags><br/>
<Tags><p></Tags><Normal Text>Please fill out the form.</Normal Text><Tags></p></Tags><br/>
<CF Tags><cfelse></CF Tags><br/>
<CF Tags><cfoutput></CF Tags><br/>
<Script Tags><cfscript></Script Tags><br/>
<Normal Text>employee</Normal Text><Script Operators>=</Script Operators><Script Functions>StructNew</Script Functions><Script Operators>()</Script Operators><Normal Text>;</Normal Text><br/>
<Normal Text>employee.firstname </Normal Text><Script Operators>=</Script Operators><Normal Text> Form.firstname;</Normal Text><br/>
<Normal Text>employee.lastname </Normal Text><Script Operators>=</Script Operators><Normal Text> Form.lastname;</Normal Text><br/>
<Normal Text>employee.email </Normal Text><Script Operators>=</Script Operators><Normal Text> Form.email;</Normal Text><br/>
<Normal Text>employee.phone </Normal Text><Script Operators>=</Script Operators><Normal Text> Form.phone;</Normal Text><br/>
<Normal Text>employee.department </Normal Text><Script Operators>=</Script Operators><Normal Text> Form.department;</Normal Text><br/>
<Script Tags></cfscript></Script Tags><br/>
<Normal Text></Normal Text><br/>
<CF Comment><!--- Display results of creating the structure. ---></CF Comment><br/>
<Normal Text>First name is #StructFind(employee, "firstname")#</Normal Text><Tags><br></Tags><br/>
<Normal Text>Last name is #StructFind(employee, "lastname")#</Normal Text><Tags><br></Tags><br/>
<Normal Text>EMail is #StructFind(employee, "email")#</Normal Text><Tags><br></Tags><br/>
<Normal Text>Phone is #StructFind(employee, "phone")#</Normal Text><Tags><br></Tags><br/>
<Normal Text>Department is #StructFind(employee, "department")#</Normal Text><Tags><br></Tags><br/>
<CF Tags></cfoutput></CF Tags><br/>
<Normal Text></Normal Text><br/>
<CF Comment><!--- Call the custom tag that adds employees. ---></CF Comment><br/>
<Custom Tags><cf_addemployee</Custom Tags><Tag Attributes> empinfo</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"#employee#"</Attribute Values><Custom Tags>></Custom Tags><br/>
<CF Tags></cfif></CF Tags><br/>
<Normal Text></Normal Text><br/>
<CF Comment><!--- The form for adding the new employee information ---></CF Comment><br/>
<Tags><hr></Tags><br/>
<Tags><form</Tags><Tag Attributes> action</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"newemployee.cfm"</Attribute Values><Tag Attributes> method</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"Post"</Attribute Values><Tags>></Tags><br/>
<Normal Text>First Name:</Normal Text><HTML Entities>&nbsp;</HTML Entities><br/>
<Tags><input</Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"firstname"</Attribute Values><Tag Attributes> type</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"text"</Attribute Values><Tag Attributes> hspace</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"30"</Attribute Values><Tag Attributes> maxlength</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"30"</Attribute Values><Tags>><br></Tags><br/>
<Normal Text>Last Name:</Normal Text><HTML Entities>&nbsp;</HTML Entities><br/>
<Tags><input</Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"lastname"</Attribute Values><Tag Attributes> type</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"text"</Attribute Values><Tag Attributes> hspace</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"30"</Attribute Values><Tag Attributes> maxlength</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"30"</Attribute Values><Tags>><br></Tags><br/>
<Normal Text>EMail:</Normal Text><HTML Entities>&nbsp;</HTML Entities><br/>
<Tags><input</Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"email"</Attribute Values><Tag Attributes> type</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"text"</Attribute Values><Tag Attributes> hspace</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"30"</Attribute Values><Tag Attributes> maxlength</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"30"</Attribute Values><Tags>><br></Tags><br/>
<Normal Text>Phone:</Normal Text><HTML Entities>&nbsp;</HTML Entities><br/>
<Tags><input</Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"phone"</Attribute Values><Tag Attributes> type</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"text"</Attribute Values><Tag Attributes> hspace</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"20"</Attribute Values><Tag Attributes> maxlength</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"20"</Attribute Values><Tags>><br></Tags><br/>
<Normal Text>Department:</Normal Text><HTML Entities>&nbsp;</HTML Entities><br/>
<Tags><input</Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"department"</Attribute Values><Tag Attributes> type</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"text"</Attribute Values><Tag Attributes> hspace</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"30"</Attribute Values><Tag Attributes> maxlength</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"30"</Attribute Values><Tags>><br></Tags><br/>
<Normal Text></Normal Text><br/>
<Tags><input</Tags><Tag Attributes> type</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"Submit"</Attribute Values><Tag Attributes> value</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"OK"</Attribute Values><Tags>></Tags><br/>
<Tags></form></Tags><br/>
<Tags><br></Tags><br/>
<Tags></body></Tags><br/>
<Tags></html></Tags><Normal Text> </Normal Text><br/>
<Normal Text></Normal Text><br/>
<CF Tags><cfoutput></CF Tags><br/>
<Normal Text>Error. No employee data was passed.</Normal Text><Tags><br></Tags><br/>
<CF Tags></cfoutput></CF Tags><br/>
<CF Tags><cfexit</CF Tags><Tag Attributes> method</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"ExitTag"</Attribute Values><CF Tags>></CF Tags><br/>
<CF Tags><cfelse></CF Tags><br/>
<CF Comment><!--- Add the employee ---></CF Comment><br/>
<CF Tags><cfquery</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"AddEmployee"</Attribute Values><Tag Attributes> datasource</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"cfdocexamples"</Attribute Values><CF Tags>></CF Tags><br/>
<Normal Text>INSERT INTO Employees</Normal Text><br/>
<Normal Text>(FirstName, LastName, Email, Phone, Department)</Normal Text><br/>
<Normal Text>VALUES (</Normal Text><br/>
<Normal Text>'#attributes.empinfo.firstname#' ,</Normal Text><br/>
<Normal Text>'#attributes.empinfo.lastname#' ,</Normal Text><br/>
<Normal Text>'#attributes.empinfo.email#' ,</Normal Text><br/>
<Normal Text>'#attributes.empinfo.phone#' ,</Normal Text><br/>
<Normal Text>'#attributes.empinfo.department#' )</Normal Text><br/>
<CF Tags></cfquery></CF Tags><br/>
<CF Tags></cfif></CF Tags><br/>
<CF Tags><cfoutput></CF Tags><br/>
<Tags><hr></Tags><Normal Text>Employee Add Complete</Normal Text><br/>
<CF Tags></cfoutput></CF Tags><br/>
<Normal Text></Normal Text><br/>
<CF Comment><!--- temperature.cfc ---></CF Comment><br/>
<CF Tags><cfcomponent></CF Tags><br/>
<Normal Text>  </Normal Text><CF Tags><cffunction</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"FtoC"</Attribute Values><Tag Attributes> access</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"public"</Attribute Values><Tag Attributes> returntype</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"numeric"</Attribute Values><CF Tags>></CF Tags><br/>
<Normal Text>    </Normal Text><CF Tags><cfargument</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"fahrenheit"</Attribute Values><Tag Attributes> required</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"yes"</Attribute Values><Tag Attributes> type</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"numeric"</Attribute Values><CF Tags> /></CF Tags><br/>
<Normal Text>    </Normal Text><CF Tags><cfset</CF Tags><Tag Attributes> answer</Tag Attributes><Normal Text>=</Normal Text><CF Tags> (fahrenheit - 32)*100/180 /></CF Tags><br/>
<Normal Text>    </Normal Text><CF Tags><cfreturn answer /></CF Tags><br/>
<Normal Text>  </Normal Text><CF Tags></cffunction></CF Tags><br/>
<CF Tags></cfcomponent></CF Tags><br/>
<CF Comment><!--- test.cfm ---></CF Comment><br/>
<CF Tags><cfset</CF Tags><Tag Attributes> fDegrees</Tag Attributes><CF Tags> </CF Tags><Normal Text>=</Normal Text><CF Tags> 212 /></CF Tags><br/>
<CF Tags><cfinvoke</CF Tags><Tag Attributes> component</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"temperature"</Attribute Values><Tag Attributes> method</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"FtoC"</Attribute Values><Tag Attributes> returnvariable</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"result"</Attribute Values><CF Tags>></CF Tags><br/>
<Normal Text>  </Normal Text><CF Tags><cfinvokeargument</CF Tags><Tag Attributes> name</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"fahrenheit"</Attribute Values><Tag Attributes> value</Tag Attributes><Normal Text>=</Normal Text><Attribute Values>"#fDegrees#"</Attribute Values><CF Tags> /></CF Tags><br/>
<CF Tags></cfinvoke></CF Tags><br/>
<CF Tags><cfoutput></CF Tags><Normal Text>#fDegrees#</Normal Text><HTML Entities>&deg;</HTML Entities><Normal Text>F = #result#</Normal Text><HTML Entities>&deg;</HTML Entities><Normal Text>C</Normal Text><CF Tags></cfoutput></CF Tags><Normal Text> </Normal Text><Tags><br /></Tags><br/>
<Normal Text></Normal Text><br/>
<CF Tags><cfset</CF Tags><Tag Attributes> person</Tag Attributes><CF Tags> </CF Tags><Normal Text>=</Normal Text><CF Tags> CreateObject(</CF Tags><Attribute Values>"component"</Attribute Values><CF Tags>, </CF Tags><Attribute Values>"Person"</Attribute Values><CF Tags>) /></CF Tags><br/>
