muhmuuh Posted August 3, 2009 Posted August 3, 2009 Hi, fellows! I've encountered a very strange error. ***.au3 (406) : ==> "If" statements must have a "Then" keyword.: If $lg[$ni] == $id Then If $lg^ ERROR The program compiles successfully and it runs to the point where I get this error. My "If" statement has a "Then". I've been staring at my code for a half-hour and I can't see what's wrong. Probably it is something very easy that I don't see so please tell me >_< Thank you I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.
muhmuuh Posted August 3, 2009 Author Posted August 3, 2009 (edited) Can you post the entire code? For $ni = 1 To $bu If $lg[$ni] == $id Then $fl = 1 ExitLoop EndIf Next The entire code is very very long and I think the other part of the code is irrelevant to the problem Edited August 3, 2009 by muhmuuh I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.
Coolw Posted August 3, 2009 Posted August 3, 2009 Does it work if you use 1 "=" instead of 2? My ProgramsMy WIP'sSteam Server Restarter
muhmuuh Posted August 3, 2009 Author Posted August 3, 2009 Does it work if you use 1 "=" instead of 2?Nope >_<Already tried that I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.
Richard Robertson Posted August 3, 2009 Posted August 3, 2009 It's possible you have a bad character code in the line. Try deleting the whole line and typing it back out to make sure there isn't an invisible character in the way.
muhmuuh Posted August 3, 2009 Author Posted August 3, 2009 It's possible you have a bad character code in the line. Try deleting the whole line and typing it back out to make sure there isn't an invisible character in the way.already done that too >_<but it still doesn't work I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.
cornernote Posted August 3, 2009 Posted August 3, 2009 what is inside the following variables? $bu $lg $id
muhmuuh Posted August 3, 2009 Author Posted August 3, 2009 (edited) what is inside the following variables?$bu $lg $id$bu and $id are integers$lg is an array of itnegers Edited August 3, 2009 by muhmuuh I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.
Richard Robertson Posted August 3, 2009 Posted August 3, 2009 It doesn't matter what the variables are. This error doesn't make much sense. By the way, when comparing integers, it is more efficient to use = than ==. == forces the numbers to strings first then compares them.
muhmuuh Posted August 3, 2009 Author Posted August 3, 2009 (edited) I found out the problem I found out that I use another variable $lg of type object Changed the variable name and it works now Thank for all responses and thanks for the "=" tip, Richard Robertson Lame error by a lame coder In my defense the error from the compiler didn't help me a lot >_< Edited August 3, 2009 by muhmuuh I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.
Richard Robertson Posted August 4, 2009 Posted August 4, 2009 You should report this to the bug trac. The error is kind of wrong.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now