IF statement is being ignored

What am I doing wrong? The IF statement is just being ignored. No response from any of the dialogs or anything.



on addTask()
	set typeOfTask to current row of matrix "tord" of view "taskProps" of window "newTask"
	if typeOfTask = "1" then
				display dialog "Number 2"
	else if typeOfTask = "2" then
		display dialog "Number 2"
	else
		display dialog "Something else"
	end if
end addTask


Thanks guys. You are always a big help.

EDIT: Ok, so the ELSE is working. That was just me overlooking it. When I echo the value of typeOfTask, it gives me 1. Why is it going to the ELSE statement when it equals 1?

Are you absolutely certain that the current row of the matrix… is text? Not a number?

Hm, try and turn the 1 into a 1 without quotations. Something like this:

 if typeOfTask is 1 then
...
end if

exactly

"1" = 1 --> false

I stopped working on it last night. After I launched Xcode this morning, it started working.
I was baffled that it wasnt working. I guess my Xcode wanted a nap :smiley:

Thank you Adam Bell and guimkie for the responses.

guimkie, that actually solved an old problem I had with a little problem with an older app I had made, so thanks for that as well.