|
-
Sep 7th, 2000, 07:16 AM
#1
Thread Starter
Lively Member
How do I exit a case statement?
Hi,
How do I get out of a case statement after a function has found a problem. What I mean is:
Code:
Select case index
Case 0
functionperformed
if x = y then
form.show vbmodal
endif
Case 1
unload me
end select
where functionperformed = the function that is performed
Now. What I want to do is exit the case statement after the function has been completed. In other words, how do i exit out of Case 0 when the function has created a problem and it needs to exit from the case index and revert back to the form originally loaded? Any help is appreciated and thanks in advance.
Mike
-
Sep 7th, 2000, 07:22 AM
#2
transcendental analytic
No way to exit a case
solution 1. use a goto, to a label after the end select
solution 2. use an if then inside the case and put the rest in else.
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.
-
Sep 7th, 2000, 07:34 AM
#3
Lively Member
Let the function return a boolean value. If the function finds a problem, return False; else return True. Then, you can use it as:
Code:
Select Case index
Case 0
If functionperformed Then
If x = y Then
Form.Show vbModal
End If
End If
Case 1
Unload Me
End Select
Hope it works!
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
|