Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions data/en/cfwhile.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
"code": "<cfset row = 0/>\r\n<cfwhile condition=\"#row LT 5#\" label=\"outerLoop\">\r\n <cfset col = 0/>\r\n <cfwhile condition=\"#col LT 5#\" label=\"innerLoop\">\r\n\r\n <cfif col EQ 3>\r\n <cfbreak/>\r\n <cfelseif row EQ 1>\r\n <cfbreak outerLoop/>\r\n </cfif>\r\n\r\n <cfoutput>[#row#, #col#]</cfoutput>\r\n\r\n <cfset col = col + 1/>\r\n </cfwhile>\r\n <cfset row = row + 1/>\r\n</cfwhile>",
"result": "[0, 0] [0, 1] [0, 2]",
"runnable": true
},
{
"title": "Script syntax with break",
"description": "A while loop from 1 to 10 that breaks once the variable reaches 5. Note that Script syntax is valid in ColdFusion even though the tag syntax is not.",
"code": "i = 1;\nwhile (i <= 10) {\n writeDump(i);\n if (i == 5) {\n break;\n }\n i++;\n}",
"result": "12345",
"runnable": true
}
]
}