title: How to nest multiple IF statements in Visual Basic 6?
body: <p>How can I use an <code>if</code> in another <code>if</code> in Visual Basic 6?</p>
  
  <p>For example, in C++ I can start my statements with <code>{</code> and finish them with <code>}</code>, and I can use another <code>if</code> in the first statement.</p>
  
  <p>For example:</p>
  
  <pre><code>if m&gt;3
  {       .....
       if a&gt;5
        {
         ......
        }
       else {....}
  } else ........
  </code></pre>
  
  <p>… but in Visual Basic there is no <code>{</code> <code>}</code> or something similar it</p>
  
  <p>i want to writ a program that recive a time from user and Reduce 4:30 from it ! for example when user runs it , it asks : what time is it in Tehran ? and user enter time (for example 16:30) and then program Reduces 4 hour and 30 minutes from it ! and print : GMT time is : 12:00 ! i'll updat my post and put my code ! please read it ! </p>
  
  <pre><code>Option Explicit
  
  Private Sub Command1_Click()
      Cls
      Dim h As Integer, m As Integer, hm As Integer, mm As Integer, t As Integer
      Dim fh As String, fm As String, fhm As String, fmm As String
  
      t = InputBox("Enter time")
      h = t \ 100
      m = t Mod 100
  
      Select Case h
  
      Case 0 To 24
  
          If m &lt; 60 Then
              If m &gt;= 30 Then
  
                  hm = h - 4
                  mm = m - 30
  
                  If h &lt; 10 Then fh = Format(h, String(2, "0")) Else fh = h
                  If m &lt; 10 Then fm = Format(m, String(2, "0")) Else fm = m
                  If hm &lt; 10 Then fhm = Format(hm, String(2, "0")) Else fhm = hm
                  If mm &lt; 10 Then fmm = Format(mm, String(2, "0")) Else fmm = mm
  
                  Print
                  Print "      Tehran  Time is  :   "; fh; ":"; fm
                  Print
                  Print "      GMT       Time is  :   "; fhm; ":"; 
              Else
                  hm = h - 5
                  mm = m + 30
  
                  If h &lt; 10 Then fh = Format(h, String(2, "0")) Else fh = h
                  If m &lt; 10 Then fm = Format(m, String(2, "0")) Else fm = m
                  If hm &lt; 10 Then fhm = Format(hm, String(2, "0")) Else fhm = hm
                  If mm &lt; 10 Then fmm = Format(mm, String(2, "0")) Else fmm = mm
  
                  Print
                  Print "      Tehran  Time is  :   "; fh; ":"; fm
                  Print
                  Print "      GMT       Time is  :   "; fhm; ":"; fmm
              End If
          End If
  
      Case Else
  
          Beep
          Print
          Print "   Time is wrong !!!  Try again "
  
      End Select
  
  End Sub
  
  Private Sub Command2_Click()
          End
  End Sub
  
  Private Sub Form_Load()
  
  End Sub
  </code></pre>