473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

continue not working

I *MUST* be overlooking something obvious. Consider the following code:

foreach($_POST as $key=>$value) {
print "$key=>$value<br />";
if(! empty($value)) {
switch($key) {
case "Submit":
case "keyList":
case "curKey":
print "Matched exception<br />";
continue;
}
print "Didn't bypass.<br />";
.......

Among the form display is:

keyList=>$keyList
Matched exception
Didn't bypass.

Obviously, the "switch" statement was properly matched as it shows it
matched the test expression. The next statement is a "continue", which
should have gone to the next statement in the loop, but it DIDN'T. It's as
if the "continue" statement was ignored. What am I missing?

Jul 17 '05 #1
2 2664
On Sun, 26 Sep 2004 14:14:39 GMT, Michael Satterwhite
<sa*****************@weblore.com> wrote:
I *MUST* be overlooking something obvious. Consider the following code:
switch($key) {
case "curKey":
print "Matched exception<br />";
continue;
}
print "Didn't bypass.<br />";
.......

Obviously, the "switch" statement was properly matched as it shows it
matched the test expression. The next statement is a "continue", which
should have gone to the next statement in the loop, but it DIDN'T. It's as
if the "continue" statement was ignored. What am I missing?


http://uk.php.net/manual/en/control-...s.continue.php

"continue

continue is used within looping structures to skip the rest of the current loop
iteration and continue execution at the beginning of the next iteration.

Note: Note that in PHP the switch statement is considered a looping
structure for the purposes of continue.

continue accepts an optional numeric argument which tells it how many levels of
enclosing loops it should skip to the end of.
"

So "continue 2" to get out of the switch and also the enclosing loop?

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
Andy Hassall wrote:
On Sun, 26 Sep 2004 14:14:39 GMT, Michael Satterwhite
<sa*****************@weblore.com> wrote:
I *MUST* be overlooking something obvious. Consider the following code:
switch($key) {
case "curKey":
print "Matched exception<br />";
continue;
}
print "Didn't bypass.<br />";
Note: Note that in PHP the switch statement is considered a looping
structure for the purposes of continue.


Thanks. While I can't think of a rational reason that a switch should be
considered a loop, there is no rule that says I have to understand it. <g>

Appreciate the help.

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrew Brampton | last post by:
Hi, I read a few months back that Edit & Continue was going to be added to VS2003 for C# and the other .Net languages... However I'm sitting in front of my newly installed Visual Studio 2003 and...
3
by: Jianli Shen | last post by:
const DInst *stopAtDst = 0; while (dinst->hasPending()) { if (stopAtDst == dinst->getFirstPending()) break; ///////break? break? break? is this break outof the whole while loop and...
7
by: Paul Reddin | last post by:
Hi, Having just upgraded one of our servers to V8.2, the CONTINUE HANDLERs in Stored procedures seem to be behaving differently? i.e Instead of continuing at the next statement (as they did...
0
by: Oenone | last post by:
My VS2005 Edit and Continue function appears to have stopped working in my VB project. It definitely was working, but now when I run my project (a WinForms project) and break into it, I am...
0
by: Brett Romero | last post by:
For what ever reason, edit and continue isn't working any more. Now I get this message: Edit and Continue Changes are not allowed if the source code on disk does not match the code running...
5
by: =?Utf-8?B?c3VydHVyeg==?= | last post by:
Hi, I feel like a noob for asking this. When I publish a VB windows application, I want to disable the ability of the the user to continue when there is an unhandled exception. For example,...
6
pythonner
by: pythonner | last post by:
Hi folks, I'm working my way through "How to Think Like a Computer Scientist Learning with Python" from this link: www.greenteapress.com/thinkpython/thinkCSpy/html/chap20.html. In 'The animal...
6
by: Gianluca Pezzoli | last post by:
I have used edit And Continue for months in Winforms applications with VS 2005 TeamEdition x Software Developers. I have windows vista with all updates. Also VS has all available updates. But...
36
by: mdh | last post by:
May I ask the group this somewhat non-focused question....having now seen "continue" used in some of the solutions I have worked on. ( Ex 7-4 solution by Tondo and Gimpel comes to mind) Is there a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.