Jump to content
Sign in to follow this  
muhmuuh

Lame error

Recommended Posts

muhmuuh

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.

Share this post


Link to post
Share on other sites
muhmuuh

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 by muhmuuh

I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.

Share this post


Link to post
Share on other sites
muhmuuh

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.

Share this post


Link to post
Share on other sites
Richard Robertson

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.

Share this post


Link to post
Share on other sites
muhmuuh

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.

Share this post


Link to post
Share on other sites
cornernote

what is inside the following variables?

$bu $lg $id

Share this post


Link to post
Share on other sites
muhmuuh

what is inside the following variables?

$bu $lg $id

$bu and $id are integers

$lg is an array of itnegers

Edited by muhmuuh

I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.

Share this post


Link to post
Share on other sites
Richard Robertson

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.

Share this post


Link to post
Share on other sites
muhmuuh

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 by muhmuuh

I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.

Share this post


Link to post
Share on other sites
Richard Robertson

You should report this to the bug trac. The error is kind of wrong.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.