D
Drydareelin
Guest
Hi all,
I've got a create event with a bunch of words in an array set up like so,
and the idea is that when I type a word in to a box, it checks through the array to see if it exists.
Currently I have the loop as;
And it works as intended. The problem is when I check for a word not in the list, I get an error. I've tried to include;
But this gives me that message for every word regardless.
But this gives me the same error as if there was no else statement at all.
Any ideas?
Edit: Meant 'create event', not 'text file'.
I've got a create event with a bunch of words in an array set up like so,
Code:
word[0] = "this";
word[1] = "is";
word[2] = "an";
word[3] = "example";
...
Currently I have the loop as;
Code:
if (check == true) //set by another object
{
for (var i = 0; i <= word_num; i++) // word_num = total number of words
{
if (word[i] == oInput.text)
{
show_message("Word " + oInput.text +" found."); // Just for now, this will do more later.
check = false;
exit;
}
// else...
}
}
Code:
else
{
show_message("Word not found.");
}
Code:
if (word[word_num] != oInput.text)
{
show_message(...);
}
Any ideas?
Edit: Meant 'create event', not 'text file'.
Last edited by a moderator: