Skip to main content

Posts

Showing posts with the label cfdump

How to get output in a file or browser using cfdump in coldfusion

cfdump - get output in a file or browser cfdumpOutput.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfdump tag: how to get output in a file or browser</title> </head> <body> <h2 style="color:OrangeRed; font-style:italic">cfdump tag example: how to get output in a file or browser</h2> <hr width="575" align="left" color="CadetBlue" /> <br /> <cfquery name="qCenters" datasource="cfdocexamples" maxrows="3"> Select Center_ID, Name From Centers </cfquery> <cfdump var="#qCenters#" label="Centers [file output]" output="c:\Centers.txt"> <br /><br /> <cfdump var="#qCenters#" label="Centers [browser output]" output="browser"...

How to use cfdump format (html, text) in ColdFusion

Introduction In Adobe ColdFusion, the <cfdump> tag is a handy tool that developers often use to debug their code by displaying the contents of variables. This tag can present data in different formats, making it easier to visualize and understand complex structures like arrays, queries, and objects. One of the key attributes of the <cfdump> tag is the format attribute, which allows developers to choose between HTML and plain text output for displaying the variable data. This tutorial demonstrates how to use the format attribute in the <cfdump> tag with a simple example involving a ColdFusion structure. The example shows how to switch between HTML and text formats for dumping variable content, which can be particularly useful in different development environments or when rendering output in specific formats for different devices. Understanding the Structure In the provided example, a structure called Color is created using ColdFusion's StructNew() function. ...

How to dump a structure using cfdump in coldfusion

cfdump - dump a structure cfdumpStructure.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfdump tag example: how to dump a structure</title> </head> <body> <h2 style="color:Crimson">cfdump Tag Example</h2> <cfset Employee=StructNew()> <cfset Employee.Name.FirstName="Jenny"> <cfset Employee.Name.LastName="Jones"> <cfset Employee.City="Rome"> <cfset Employee.Email="Jenny@test.com"> <cfset Employee.StartDate="5-Dec-2005"> <cfdump var="#Employee#" label="Employee"> </body> </html> More ColdFusion examples cfdump - dump an array StructKeyArray() - get an array of keys from a structure StructKeyExists() - check whether a specific key is present in a struc...

How to dump an array using cfdump in coldfusion

cfdump - dump an array cfdumpArray.cfm <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cfdump tag example: how to dump an array</title> </head> <body> <h2 style="color:Crimson">cfdump Tag Example</h2> <cfset ColorArray=Arraynew(2)> <cfset ColorArray[1][1]="AliceBlue"> <cfset ColorArray[1][2]="##F0F8FF"> <cfset ColorArray[2][1]="AntiqueWhite"> <cfset ColorArray[2][2]="##FAEBD7"> <cfset ColorArray[3][1]="Aqua"> <cfset ColorArray[3][2]="##00FFFF"> <cfdump var="#ColorArray#" label="ColorArray"> </body> </html> More ColdFusion examples ArraySort() - sort array elements ArraySum() - get sum of values in an array ArraySwap() - swap array valu...

ColdFusion CFDUMP: How to show query output

Introduction ColdFusion is a powerful web development platform that simplifies many tasks, including database interaction and debugging. One of the key features of ColdFusion is the <cfdump> tag, which makes it easy for developers to output complex data structures, such as arrays, objects, and especially query results, in a human-readable format. In this article, we will explore how to use the <cfdump> tag to display the output of a query. This feature is especially useful for debugging and testing your code, ensuring that you can see exactly what data is being returned by your database. We’ll walk through a simple ColdFusion page example that connects to a database, retrieves data from a table, and uses <cfdump> to display the query output. This method provides developers with a clear visual representation of their database queries, making it easier to troubleshoot and verify results. Querying the Database The example starts by defining a query using the <cfque...