Execution Order

  • Thread starter Thread starter Ricky W. Hunt
  • Start date Start date
R

Ricky W. Hunt

VB.NET seems to be processing things in a different "order" than I'm used
to. For example, I had a problem (I don't have the exact code handy anymore
so it's just a "guess") where if I put the complete code in a single
subroutine it wouldn't work but if I put the part that wasn't working in a
subroutine, and called it after the first subroutine finished, would work
even though if you laid out the actual commands linearly ("in order") they
would be exactly the same. Does anyone know why this happens and what is it
"called"?
 
* "Ricky W. Hunt said:
VB.NET seems to be processing things in a different "order" than I'm used
to. For example, I had a problem (I don't have the exact code handy anymore
so it's just a "guess") where if I put the complete code in a single
subroutine it wouldn't work but if I put the part that wasn't working in a
subroutine, and called it after the first subroutine finished, would work
even though if you laid out the actual commands linearly ("in order") they
would be exactly the same. Does anyone know why this happens and what is it
"called"?

Normally, this should not occur. I can imagine some situations where
placing code in a separate procedure and calling this procedure may
behave differently because of a possible small delay caused by the call
to the method, but in general, there must not be a difference.
 
Herfried K. Wagner said:
Normally, this should not occur. I can imagine some situations where
placing code in a separate procedure and calling this procedure may
behave differently because of a possible small delay caused by the call
to the method, but in general, there must not be a difference.

That was my guess too. So I tried putting a Sleep command (up to 5 seconds -
5000ms) and it still didn't work. Only when I put it another block did it
work. I will try to come up with the exact code again and post it to see if
you have any clues. BTW, thanks for all the help you provide.
 
Ricky W. Hunt said:
VB.NET seems to be processing things in a different "order" than I'm used
to. For example, I had a problem (I don't have the exact code handy anymore
so it's just a "guess") where if I put the complete code in a single
subroutine it wouldn't work but if I put the part that wasn't working in a
subroutine, and called it after the first subroutine finished, would work
even though if you laid out the actual commands linearly ("in order") they
would be exactly the same. Does anyone know why this happens and what is it
"called"?

Are you reusing a variable name in the subroutine whic when the code is
linear alters its operation ? Just a guess.
 
* "Ricky W. Hunt said:
That was my guess too. So I tried putting a Sleep command (up to 5 seconds -
5000ms) and it still didn't work. Only when I put it another block did it
work. I will try to come up with the exact code again and post it to see if
you have any clues. BTW, thanks for all the help you provide.

OK, I think it doesn't make much sense to discuss this topic without the
source code that caused the problem.
 
Are you reusing a variable name in the subroutine whic when the code is
linear alters its operation ? Just a guess.

No. It's just a call to the Window's Media Player. No variables involved at
all
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top