|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
nested select problemDim b As Double Dim c As Double a = 36.8 b = 44 select case a case 36.6 to 37 MsgBox "???" Select Case b Case 42 To 43 c = 26 MsgBox "hmm"'<<<<< this shud be shown as this is the point but it isnt giving me this msgbox :S :S Case 44 To 45 c = 26.5 Case Else End Select End Select what am i doing wrong? On 9/2/2010 8:24 PM, Sabbir Ahmad wrote:
Show quoteHide quote > Dim a As Double What happens when you run this?> Dim b As Double > Dim c As Double > a = 36.8 > b = 44 > select case a > case 36.6 to 37 > MsgBox "???" > Select Case b > Case 42 To 43 > c = 26 > MsgBox "hmm"'<<<<< this shud be shown as this is the point but it > isnt giving me this msgbox :S :S > Case 44 To 45 > c = 26.5 > Case Else > End Select > End Select > what am i doing wrong? Private Sub Command1_Click() Dim a As Double, b As Double, c As Double a = 36.8 b = 44 Select Case a Case 36.6 To 37 Debug.Print "a : in range 36.6 to 37" Case Else Debug.Print "a : not in range 36.6 to 37" End Select Select Case b Case 42 To 43 Debug.Print "b : in range 42 To 43" c = 26 Case 44 To 45 Debug.Print "b : in range 44 To 45" c = 26.5 Case Else Debug.Print "b : not in range 42 to 43, 44 To 45" End Select Debug.Print "c : " & c End Sub "Sabbir Ahmad" <sabbirahmad.***@gmail.com> wrote Try> a = 36.8 > b = 44 b = 43 LFS Your message box is called in a Case where
a is 36.6 to 37 and b is 42 or 43. But you have b as 44. It's just a simple oversight. Show quoteHide quote | Dim a As Double | Dim b As Double | Dim c As Double | | a = 36.8 | b = 44 | | select case a | case 36.6 to 37 | MsgBox "???" | | Select Case b | | | Case 42 To 43 | | c = 26 | MsgBox "hmm"'<<<<< this shud be shown as this is the point but it | isnt giving me this msgbox :S :S | | Case 44 To 45 | c = 26.5 | | Case Else | End Select | | End Select | | | what am i doing wrong? "Sabbir Ahmad" <sabbirahmad.***@gmail.com> wrote in message Thinking that 44 is between 42 and 43....news:b4cd13a5-bee8-43e0-bd4f-40518d3e0e87@e14g2000yqe.googlegroups.com... > what am i doing wrong? "Jeff Johnson" <i.get@enough.spam> wrote in message Well,for extremely small values of 44...news:i5r0eo$ctn$1@news.eternal-september.org... > "Sabbir Ahmad" <sabbirahmad.***@gmail.com> wrote in message > news:b4cd13a5-bee8-43e0-bd4f-40518d3e0e87@e14g2000yqe.googlegroups.com... > >> what am i doing wrong? > > Thinking that 44 is between 42 and 43.... http://www.zazzle.com/2_2_5_tshirt-235465381553974025
What Is the User Path for Deployment Similar to $(AppPath)?
Looking for VC6 newsgroup Error 481 Invalid picture Global class and WithEvents Distibution of VB6 program Lockup Continues Why doesn't this work (sendmessage) Showing/Using Sort arrows on vb6 listviews? Closing Grouped instances in the taskbar Componenet not installed correctly by PDW |
|||||||||||||||||||||||