473,950 Members | 36,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

continue not working

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

foreach($_POST as $key=>$value) {
print "$key=>$value<b r />";
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=>$keyLi st
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 2705
On Sun, 26 Sep 2004 14:14:39 GMT, Michael Satterwhite
<sa************ *****@weblore.c om> 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.andyhsoftwa re.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.c om> 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
2583
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 Edit & Continue seems to not work still :( Can someone confirm if Edit & Continue doesn't work... and if it doesn't why doesn't it, and when will it start working? Thanks
3
2059
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 never in the loop again??????????????????????? DInst *dstReady = dinst->getNextPending();
7
5239
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 before on V8.1) they now exit immmediately ???? e.g from 1 SP
0
1242
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 unable to edit the source. I simply get a message telling me that I "Cannot currently modify this text in the editor. Is is read-only." I've ensured that Edit and Continue is enabled in the IDE's Options/Debugging window, my projects are running in...
0
1230
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 in the process. Files in this project can be edited while you are debugging if Edit and Continue is turned off. I also notice the Edit and Continue option is grayed out in options.
5
5178
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, if there is a bug in the program that causes an exception, I want the program to crash. If there is an unhandled exception the program is in an undefined state, and continuing could be dangerous. I'm surprised the
6
8175
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 tree" program I keep getting a " 'continue' not properly in loop" error. It's coming from the "make a guess" section of the code: # make a guess guess = tree.getCargo() prompt = "Is it a " + guess + "? "
6
2431
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 in the last 2/3 weeks edit and continue has stopped working. I have used (to test it) a project as described in http://msdn.microsoft.com/vstudio/tour/vs2005_guided_tour/VS2005pro/Smart_Client/EditContinue.htm
36
2692
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 good principle/s for the good usage of "continue"...or...do any of the regular/irregular contributors have a "favorite" way in which it is particularly useful. Thanks as usual.
0
10171
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11191
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8268
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7443
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4550
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3558
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.