|
-
Jun 1st, 2000, 08:47 AM
#1
Thread Starter
Hyperactive Member
I need a way to run subs/functions one after the other BUT make each wait untill the previous is finished.
Example:
private sub ProccessALL ()
call ProccessFile
call showinfo ' should run AFTER "ProccessFile" finished
call MakeAll ' should run AFTER "showinfo" finished
end sub
In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.
- Douglas Adams
The Hitchhiker's Guide to the Galaxy
-
Jun 1st, 2000, 09:44 AM
#2
Hyperactive Member
What are you talking about? Your code will do exactly what you want it to do.
-
Jun 1st, 2000, 10:36 AM
#3
Thread Starter
Hyperactive Member
Well, that's what I thought, but from some reason, it doesn't ... , it just goes through all of them in a row and the last one is finished before the first one is done..
In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.
- Douglas Adams
The Hitchhiker's Guide to the Galaxy
-
Jun 1st, 2000, 11:30 AM
#4
Hyperactive Member
What are you doing in these 3 functions?
-
Jun 1st, 2000, 01:04 PM
#5
PowerPoster
Return value
May be you can return a value from each function
- ProccessFile
- showinfo
- MakeAll
So that you can base on the return value to determine whether the program should continue with the next function or skip the next coming up function.
Let assume each function will return a Boolean value either True or False. (True = Succesfful, False = Fail)
Code:
If ProcessFile Then
If showinfo Then
If MakeAll Then
MsgBox "All the function is completed!.", vbExclamation
Else
MsgBox "MakeAll function does not completed!.", vbExclamation
End If
Else
MsgBox "showinfo function does not completed!.", vbExclamation
End If
Else
MsgBox "ProcessFile function does not completed!.", vbExclamation
End If
-
Jun 1st, 2000, 08:06 PM
#6
transcendental analytic
I can't see the problem either, that should work totally in the order you have put them.
You could put a breakpoint on the first and then press F8 so you can follow in which order all executes
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 1st, 2000, 11:22 PM
#7
Thread Starter
Hyperactive Member
Well, the thing it does is parsing a text file, and putting all the information into a dictionary object, and than it makes folders (according to the keys in the dictionary object), the last step is making text files under each folder (in each file there is part of the original file).
Chris gave a nice way to do it, but I will be more than happy to get some other ideas as well :-)
Thank you every body.
In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.
- Douglas Adams
The Hitchhiker's Guide to the Galaxy
-
Jun 2nd, 2000, 01:21 AM
#8
transcendental analytic
Another possible thing that can cause this is if you enable a timercontrol which inhibits it's code wherever it you got a doevents... Have you tried to use F8 as i said?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 2nd, 2000, 05:13 AM
#9
I'm sorry to disagree with some of you folks, but the code as shown in the original post will ALWAYS run one after the other, and you don't need to turn them into functions that return something in order to ensure that. What CAN happen however is that ProcessFile calls some routine or causes some other routine to be called, and that routine then calls MakeAll, which may make it seem like the routines are running out of order. Even in that case however, when ProcessFile is done, showinfo will run and then MakeAll (again) unless there is an "End" someplace inbetween. To find out what's going on, set a breakpoint in MakeAll and when that routine is reached, examine the call tree to see how it got there.
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
|