Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-09-2009
Member
 
Join Date: Oct 2008
Posts: 79
When do we need to use endif to end the conditional statement?

I just wanted to know what all things I need to know to think about the endif statement. When are you supposed to use endif to end the conditional statement. A conditional statement is a way for you to execute commands based on if a condition is true. It is easiest to understand by examples. Please let me know the suggestions for it.
Reply With Quote
  #2  
Old 14-09-2009
Member
 
Join Date: Jan 2006
Posts: 6,878
Re: When do we need to use endif to end the conditional statement?

In the conditional statement "if", while at the time of closing the if condition we use the endif in the traditional way. If you want to execute more than one statement when a condition is true, you must put each statement on separate lines, and end the statement with the keyword "End If":

Code:
If i=10 Then
msgbox "Hello"
i = i+1
End If
Reply With Quote
  #3  
Old 14-09-2009
Member
 
Join Date: Feb 2009
Posts: 105
Re: When do we need to use endif to end the conditional statement?

A conditional statement is a way for you to execute commands based on if a condition is true. It is easiest to understand by examples. You can use the If...Then...ElseIf statement if you want to select one of many blocks of code to execute: In the Code Editor, click the arrow of the Object combo box and select Form. This tutorial relies on you understanding how variables work.
Reply With Quote
  #4  
Old 14-09-2009
Member
 
Join Date: Oct 2008
Posts: 132
Re: When do we need to use endif to end the conditional statement?

The standard conditional statement: the value of the Boolean expression is evaluated. If the result is {true}, the first block of statements is executed, if the result is {false} the second block of statements is executed. For example if we set var1 = 5 and have the statement If var1 < 10 Then ... We can read it as follows if 5 is Less Than 10 - This would be true so our code gets executed.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "When do we need to use endif to end the conditional statement?"
Thread Thread Starter Forum Replies Last Post
Excel Macros for conditional formatting statement in Excel Kungfu Pandey Microsoft Project 1 08-01-2012 08:35 PM
Dns delegation vs Conditional forwarding aconti Active Directory 4 16-11-2009 12:33 PM
Conditional forwarder not resolving dwiddifield Networking & Security 0 27-08-2009 08:25 AM
Conditional formatting in excel RockeЯ Windows Software 4 27-06-2009 12:06 PM
What is the difference between while statement & do statement? Athos Software Development 4 25-02-2009 08:52 PM


All times are GMT +5.5. The time now is 04:40 AM.