Currently Being ModeratedFeb 1, 2013 1:51 PM (in response to Boboonski)
first thing that pops up (assuming all the stuff in the if button/end runs without error) is that economy1 is not any of those values
You should set economy2 to some value so that if it is not set by all the if's you'll catch that condition.
Currently Being ModeratedFeb 1, 2013 2:11 PM (in response to Boboonski)
Maybe your code isn't setting it right. Maybe the file is messed up.
It's good programming practice in a case like this to set economy2 to something before you start or to have a default condition to catch the times that economy1 is not set to any of the expected values.
It will cost you nothing to put a
set economy2 to 0
at the top of your code. Then if the display dialog prints out 0 you know what happened.
Currently Being ModeratedFeb 1, 2013 2:16 PM (in response to Boboonski)
You are reading text but comparing it to a number. The solution is to either compare to text such as "-1" or coerce the text item read to a number, e.g. set economy1 to text item 1 of fileContents as number. Don't forget to reset the text item delimiters.
Currently Being ModeratedFeb 1, 2013 2:23 PM (in response to Boboonski)
See by following good programming practices you were able to debug your program.
By setting economy2 to some value and have it print out that value rather then having the program error you can see that economy1 was not being set as you thought it was. Then it was just a matter of locating the problem.
Currently Being ModeratedFeb 1, 2013 2:25 PM (in response to Boboonski)
As a debugging check, insert the line "return economy1" just to see if it is what you expect. If it is not, it might also help you figure out why not.
EDIT: looks like you already found the answer.