# Else/if with loaded variables

**URL:** https://forum.kirupa.com/t/else-if-with-loaded-variables/231781
**Category:** Uncategorized
**Created:** [July 8, 2007, 1:30am UTC](https://forum.kirupa.com/t/else-if-with-loaded-variables/231781 "2007-07-08T01:30:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cubed](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@cubed](https://forum.kirupa.com/u/cubed)
#### Post date: [July 8, 2007, 1:30am UTC](https://forum.kirupa.com/t/else-if-with-loaded-variables/231781/1 "2007-07-08T01:30:52Z")

</div>

I’m trying to create a quick prototype of an application so i decided to use text file based variables. This was an hours work that has turned into a days worth of hassle!!

I just cannot get the else/if statements to work with my variables…  
Here is a simplified code that I am trying to use:

```auto

myData = new LoadVars(); 
myData.onLoad = function(){ 
displaybut();

}; 

myData.load("variables.txt"); 

 

function displaybut(){ 

if (myData.quest == 1){ 

trace ("it worked"); 

}else{ 

trace ("damn it"); 

trace (myData.quest); 

} 

} 

```

This is the text file:

```auto

dispp=just some text  
&quest=1 

```

This is what it traces:

```auto

■■■■ it
1

```

I don’t understand why it does this! Please help me…
