|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to break If statementI have if Statement as follows. IF a < B Then if C < D then break if Statement A Statement B Statement C End IF What I want is when C<D , then the external If statement can be break and Statement A,B,C is not run. IF C is not < D, then Statement A,B,C is executed. Can I do that in VB? Thanks
Show quote
"hon123456" <peterhon***@yahoo.com.hk> wrote in message Normally you would just donews:9b3253e6-f1d2-4f85-aee0-c11c5598bd85@s36g2000prg.googlegroups.com... > Dear all, > > I have if Statement as follows. > > > IF a < B Then > if C < D then break if > > Statement A > Statement B > Statement C > > End IF > > > What I want is when C<D , then the external If statement can be break > and Statement A,B,C is not run. IF C is not < D, then Statement A,B,C > is executed. Can I do that in VB? > > Thanks > > If A < B Then IF D > C Then Statement A Statement B Statement C End If End If On Thu, 29 Nov 2007 00:02:25 -0800 (PST), hon123456
<peterhon***@yahoo.com.hk> wrote: Show quote >Dear all, Well you could try:> > I have if Statement as follows. > > > IF a < B Then > if C < D then break if > > Statement A > Statement B > Statement C > > End IF > > >What I want is when C<D , then the external If statement can be break >and Statement A,B,C is not run. IF C is not < D, then Statement A,B,C >is executed. Can I do that in VB? > >Thanks > IF a < B Then if C < D then go to EndIf_01 else Statement A Statement B Statement C end if End IF EndIf_01: Or even this ugly mess: IF a < B Then if C < D then ' Do nothing... else Statement A Statement B Statement C end if End IF Of course the structure of the above example sucks, this code is much more readable and acceptable: IF a < B Then if C >= D then Statement A Statement B Statement C end if End IF but whatever floats your boat! |
|||||||||||||||||||||||