# How to implement if then else

**URL:** https://www.finalbuilder.com/forums/t/how-to-implement-if-then-else/937
**Category:** Discussion
**Created:** [August 25, 2008, 12:03pm UTC](https://www.finalbuilder.com/forums/t/how-to-implement-if-then-else/937 "2008-08-25T12:03:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [August 25, 2008, 12:03pm UTC](https://www.finalbuilder.com/forums/t/how-to-implement-if-then-else/937/1 "2008-08-25T12:03:46Z")

</div>

Hi,

I set up a variable say LoggedInUser(default value to test).&nbsp; And I am accepting user input for that variable(in after action event).&nbsp; After that i am checking if LoggedInUser = "Lakshmi", then in another action script i am displaying some text.&nbsp; But though i did not gave Lakshmi it is displaying text.

Here is action sequence i am executing

Main

&nbsp;Run action list Sample1

Action List Sample1

Define variable(here i am defining LoggedInUser variable and setting it to test(default value). and on AfterAction script i wrote the following code

LoggedInUser= InputBox("Enter your name")  
MsgBox ("in procedure")  
MsgBox LoggedInUser

and i am also checking if LoggedInUser = Lakshmi

running another action script MessageBox

Action List MessageBox

Here i am defining one more variable user.&nbsp; and on BeforeAction script i am displaying text.

But it is displaying the text even though i did not gave Lakshmi.&nbsp;&nbsp; I observed one thing.&nbsp; After running all scripts the status of if then is skipped instead of completed.

What i have to do now?

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [August 26, 2008, 1:24am UTC](https://www.finalbuilder.com/forums/t/how-to-implement-if-then-else/937/2 "2008-08-26T01:24:10Z")

</div>

Hi Lakshmi,   
  
 I’m not entirely sure of the problem, but can I suggest that you use the Interactive actions to prompt the user for information rather than using script (have a look at either “InputBox” or “Prompt for Variables” actions).   
  
 Also, we strongly recommend that you define all your variables via the Edit Variables dialog (under tools menu), rather that defining them within your build.   
  
 If you’re still unable to get this working, please send us your project at support at finalbuilder dot com and we’ll take a look.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [August 27, 2008, 10:55am UTC](https://www.finalbuilder.com/forums/t/how-to-implement-if-then-else/937/3 "2008-08-27T10:55:12Z")

</div>

Hi,   
  
 Mine is a sample test program like HelloWorld. But i am not able make this working. I will send my project [support@finalbuilder.com](mailto:support@finalbuilder.com).   
  
 Regards
