|
-
Mar 27th, 2001, 08:26 PM
#1
Thread Starter
Hyperactive Member
From within Sub1 I call to Sub2, from there Icall to Sub3 This is:
Sub1->Sub2->Sub3
The back way must be: Sub3->Sub2->Sub1
But the back way it takes is Sub3->Sub1 and all the code after I called the Sub3 is omitted!!
Sub1 is into a Form and Sub2 and Sub3 are into a Module.
-
Mar 27th, 2001, 08:36 PM
#2
Code:
Sub One
Print "Sub1Start"
Call Two
Print "Sub1End"
End Sub
Sub Two
Print "Sub2Start"
Call Three
Print "Sub2End"
End Sub
Sub Three
Print "Sub3Start"
Print "Sub3End"
End Sub
Your code:
It should output like this:
Sub1Start
Sub2Start
Sub3Start
Sub3End
Sub2End
Sub1End
-
Mar 27th, 2001, 08:46 PM
#3
Thread Starter
Hyperactive Member
That is the result I must get but the real result I get is (into my complete code) :
Sub1Start
Sub2Start
Sub3Start
Sub3End
Sub1End
It omits the Sub2End.
Obviously I must have anything into my code so that I get this rare result, but What could it be the problem?
Ulises Vázquez
[size=1.7]Oracle DBA Certified Professioanl
Visual Basic 6 Developer
Crystal Reports Designer
[/size]
-
Mar 27th, 2001, 08:51 PM
#4
Are you sure you don't have an exit sub statement somehwere in your second sub?
Try this: Create a new project, add the code I gave you into a button, press the button and post the results.
-
Mar 27th, 2001, 08:54 PM
#5
Frenzied Member
Or step through your code and watch what happens using the debugger. An error handler or GoTo may also be the culprit.
-
Mar 27th, 2001, 09:08 PM
#6
Thread Starter
Hyperactive Member
Megatron, seaweed:
I did what you say, from the End Sub line of the Sub3, it jumps to the next line on Sub1
Of course I I oen a new project and put the code that Megatron gave me, it works. The problem is not constant, is an extrange behavior just into my actual program.
I traced it several times and I apparently don't have any exit sub or another statament that make this rare behavior.
-
Mar 28th, 2001, 01:04 PM
#7
Frenzied Member
Post the subs. (If they are too big to post, zip them and attach them to your post).
We will get to the bottom of this!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|