Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

moved examples after explanation #50

Merged
merged 1 commit into from

2 participants

@orangexception

This flows better while reading to me. I'd like to read what we're going to do before seeing the code. Separating the tag and syntax helps to find the specific code without forcing us to sort which is which.

@mhenke mhenke merged commit 0331195 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 30, 2011
  1. @orangexception
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 cfml100mins.markdown
View
8 cfml100mins.markdown
@@ -595,6 +595,8 @@ While it's not strictly necessary to prepend the recordset name before the colum
You can also loop through a query using standard loop constructs, though they differ when using tags and script.
+When looping through a query with ```<cfloop>```, you need to make sure you have a ```<cfoutput>``` tag around your content (or around the loop) to ensure the ColdFusion instructions are recognized.
+
#### Tag
```cfm
@@ -603,6 +605,8 @@ You can also loop through a query using standard loop constructs, though they di
</cfloop>
```
+When looping through a query in ```cfscript```, you'll need to reference the query just like you would a multidimensional array, using the counter set up in your for statement to pick up the correct row from the recordset. So the syntax becomes "recordsetName.ColumnName[rowNumber]".
+
#### Syntax
```cfm
@@ -613,10 +617,6 @@ for (x = 1; x <= GetBreakfastItems.RecordCount; x++) {
</cfscript>
```
-When looping through a query with ```<cfloop>```, you need to make sure you have a ```<cfoutput>``` tag around your content (or around the loop) to ensure the ColdFusion instructions are recognized.
-
-When looping through a query in ```cfscript```, you'll need to reference the query just like you would a multidimensional array, using the counter set up in your for statement to pick up the correct row from the recordset. So the syntax becomes "recordsetName.ColumnName[rowNumber]".
-
## 7. Arrays
Often we need to organize a group and put them into a *collection*. There are two main types of collections: **arrays** and **structures**.
Something went wrong with that request. Please try again.