473,698 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'break' Causes Execution of Procedure?

Hi, everyone,

I have a bug in a script of several hundred lines of code that I cannot
figure out. I have attempted (unsuccessfully ) to duplicate this problem in
a smaller script that I can post here but have been unsuccessful. As such,
I'm posting code snippets here in the hopes that someone recognizes a very
basic mistake I've made and can straighten me out.

First, the portion of my text file that executes my code:

<quote>
if __name__ == '__main__':
if len(sys.argv) != 2:
print('usage: %s <config_file> ' % sys.argv[0])
sys.exit()

main(sys.argv[1])
</quote>

Here are the first few lines of my 'main' procedure:
<quote>
def main(fileName):
print('DEBUG: begin main procedure')
...
</quote>

And here is the part that is causing problems:
<quote>
# 'keys' is a list of integers returned from dict.keys()
for cycle in keys:
if key in skipList:
print ('skipping %d/%d' % (cycle, cycleMap[cycle]))
continue
try:
print('DEBUG: advancing both simulators to %d' % cycle)
procedureThatCo uldRaiseEOFErro r()
except EOFError:
print('DEBUG: encountered EOFError; breaking loop')
break
print('DEBUG: All cycles processed')
</quote>

Here's what I can't figure out. I'm seeing the following text generated
during this script's execution:
<quote>
DEBUG: advancing both simulators to 20178
DEBUG: encountered EOFError; breaking loop
DEBUG: begin main procedure
</quote>

How is it possible that the call to 'break' is seemingly being replaced with
a call to 'main'?

Thanks!
Scott

--
Remove .nospam from my e-mail address to mail me.

Jul 18 '05
10 1981
"John J. Lee" <jj*@pobox.co m> wrote in message
news:87******** ****@pobox.com. ..
"Scott Brady Drummonds" <sc************ **********@inte l.com> writes:
[...]
DEBUG: advancing both simulators to 20178

[...]

Is this a threaded program?


Nope.

Scott

--
Remove .nospam from my e-mail address to mail me.

Jul 18 '05 #11

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

Similar topics

1
2013
by: Vinny | last post by:
Can anyone help me with this strange problem please? I have a stored procedure, with a parameter defined as a uniqueidentifier. The procedure does a select with a number of joins, and filters within the Where clause using this parameter. (@orderHeader_id uniqueidentifier) SELECT *
5
4149
by: mas | last post by:
I have a Stored Procedure (SP) that creates the data required for a report that I show on a web page. The SP does all the work and just returns back a results set that I dump in an ASP.NET DataGrid. The SP takes a product area and a start and end date as parameters. Here are the basics of the SP. 1. Create temp table to store report results, all columns are created that will be needed at this point. 2. Select products and general...
1
9707
by: Raquel | last post by:
This is a stored procedure that resides on Mainframe and gets executed on the client by connecting to the mainframe through DB2 connect. It was executing fine till yesterday when I executed a table change and successfully Rebound the package associated with the stored procedure. Since then, it is giving a strange problem. When the client executes the program that calls the stored procedure SP1, the stored procedure does not get executed...
9
13204
by: Bill Borg | last post by:
Hello, I call a function recursively to find an item that exists *anywhere* down the chain. Let's say I find it five layers deep. Now I've got what I need and want to break out of that whole stack and continue execution at the point of the initial call. Is that possible? Thanks, Bill
8
2630
by: Frank van Vugt | last post by:
Hi, If during a transaction a number of deferred triggers are fired, what will be their execution order upon the commit? Will they be executed in order of firing or alfabetically or something entirely different? The docs only mention regular triggers being executed alfabetically.
4
6960
by: TheRealPawn | last post by:
I'm trying to get the execution plan for a single stored procedure from Profiler. Now, I've isolated the procedure but I get all execution plans. Any ideas on how to connect the SPIDs so that I only get the execution plan for the procedure I'm watching and not the whole of the server?
5
10750
by: sqlgirl | last post by:
Hi, We are trying to solve a real puzzle. We have a stored procedure that exhibits *drastically* different execution times depending on how its executed. When run from QA, it can take as little as 3 seconds. When it is called from an Excel vba application, it can take up to 180 seconds. Although, at other times, it can take as little as 20 seconds from Excel.
3
31435
by: Yansky | last post by:
Hi, I've looked through the tutorial on w3cschools.com, but I'm still uncertain as to the difference between using break and using return. If I have a simple "for" loop that I want to stop if a condition is met, should I use break or return to stop the loop? e.g. is something like this ok? Would using return do the same thing? var dow = ;
2
9038
by: smileprince00 | last post by:
what is meant by break point in the sql server studio.. what is the purpose of it..let me know clearly........................ and one more thing is i am hearing a word regularly while studying about sql server and ms visual stdio.. i.e INTELLISENSE can you explain me clearly what it is and why it is used . hoping for a better and earlier result thank you regards
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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
8904
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,...
1
6531
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
5867
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
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.