Skip to content

Update cfwhile.json #1696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
}
]
}