Re: [Tutor] Problem with logic while extracting data from binary file

2008-04-01 Thread Michael Langford
I tried to extract methods, and invert your logic of your if/else statements as to put shorter code blocks higher, and tried to roll many of your if statements into the checks of the while loops. This is algorithm I ended up with. Is this what you were trying to do? The last while loop is pointless

Re: [Tutor] Problem with logic while extracting data from binary file

2008-03-28 Thread Bryan Fodness
Thanks again, Still lost, even with watching the variables. I see that it kicks out of the loop, but don't understand what I have done to cause this. I'm sorry for repeated emails, but I have spent multiple days on this. I have added another while loop that I think should work, but I can't seem

Re: [Tutor] Problem with logic while extracting data from binary file

2008-03-27 Thread bob gailer
Bryan Fodness wrote: > > I have not used a debugger yet, I was getting ready to try that. I am > using IDLE on Windows Vista. > Ah. May I recommend Python for Windows. The debugging support is excellent. I prefer it to IDLE. http://sourceforge.net/projects/pywin32/ -- Bob Gailer 919-636-423

Re: [Tutor] Problem with logic while extracting data from binary file

2008-03-27 Thread bob gailer
Bryan Fodness wrote: > Thanks again, The problem is that parseSequence gets the length of the block, then, in effect, skips to the next block. That bypasses the sub-sequences you want. parseSquence needs to examine the block for the sub-blocks beginning with \n0\x84\x00. This will probably requ

Re: [Tutor] Problem with logic while extracting data from binary file

2008-03-27 Thread Bryan Fodness
On Thu, Mar 27, 2008 at 6:43 PM, bob gailer <[EMAIL PROTECTED]> wrote: > Bryan Fodness wrote: > > Thanks again, > > The problem is that parseSequence gets the length of the block, then, in > effect, skips to the next block. That bypasses the sub-sequences you want. > > parseSquence needs to exam

Re: [Tutor] Problem with logic while extracting data from binary file

2008-03-27 Thread Bryan Fodness
Thanks again, I can't seem to keep track of my start values when I break up the value variable into svalues. Do you think I should do this, or should I have a running count from the beginning of the file and keep track until the end? I am trying to find \n0\x82\x00 and \n0\x84\x00 within the blo

Re: [Tutor] Problem with logic while extracting data from binary file

2008-03-27 Thread Bryan Fodness
the start_2 is supposed to be start On Thu, Mar 27, 2008 at 5:42 PM, Bryan Fodness <[EMAIL PROTECTED]> wrote: > Thanks again, > > I can't seem to keep track of my start values when I break up the value > variable into svalues. Do you think I should do this, or should I have a > running count fro

Re: [Tutor] Problem with logic while extracting data from binary file

2008-03-26 Thread bob gailer
Please always reply to the list not just me. Bryan Fodness wrote: > > Thanks Bob, > > I was having trouble with that loop from the start. Could you tell me > what a=3 is doing, I cannot seem to figure it out. I accidentally left that in. It was a place for me to set a breakpoint in the debugg

Re: [Tutor] Problem with logic while extracting data from binary file

2008-03-25 Thread bob gailer
Bryan Fodness wrote: Here is my program.  Thank you for asking. I for one don't have the time or energy to go through this program in detail. It would be very helpful if you were to define a few things more clearly. You probably think you have done this but I don't get it. What is a sequ

[Tutor] Problem with logic while extracting data from binary file

2008-03-25 Thread Bryan Fodness
Here is my program. I am trying to extract values from a binary file for use in a calculation. I am having trouble with the logic. Everything goes well until I use the parseSequence function. If there is only one sequence I seem fine, but if there is a sequence within a sequence everything seem