Skip to content

Commit 352cc59

Browse files
authored
Merge pull request #1696 from scallahan-dev/patch-5
Update cfwhile.json
2 parents 28db389 + eb833cc commit 352cc59

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

data/en/cfwhile.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
"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>",
2828
"result": "[0, 0] [0, 1] [0, 2]",
2929
"runnable": true
30+
},
31+
{
32+
"title": "Script syntax with break",
33+
"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.",
34+
"code": "i = 1;\nwhile (i <= 10) {\n writeDump(i);\n if (i == 5) {\n break;\n }\n i++;\n}",
35+
"result": "12345",
36+
"runnable": true
3037
}
3138
]
3239
}

0 commit comments

Comments
 (0)