Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2238 closed Bug (No Bug)

Syntax check warning on using variable inside declare state

Reported by: MrCreatoR <mscreator@…> Owned by:
Milestone: Component: AutoIt
Version: 3.3.8.1 Severity: None
Keywords: Syntax, Dim Cc:

Description

I got warning with this example:

Dim $aArr[10] = [UBound($aArr)-1]
MsgBox(64, 'Title', Ubound($aArr))

But if i press «Continue anyway», the MsgBox shown and the array declared properly.

So the syntax is ok?

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed
  1. It would have been helpful if you had provided the warning message.
  2. See the part in the new ticket guidelines where it says "If you are asking a question you are at the wrong place"? You're at the wrong place.
  3. That is some incredibly stupid code.

comment:2 Changed 7 years ago by MrCreatoR <mscreator@…>

  1. I thought the warning is obvious:
    WARNING: $aArr: possibly used before declaration.
    Dim $aArr[10] = [UBound($aArr)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    
  2. I don't asking a question, it was rhetorical.
  3. The code is probably stupid, but AutoIt interpreter handle it properly. Just try to compile the script (ignore the warning) and run it.

comment:3 Changed 7 years ago by trancexx

I will ask question then. Do you know difference between warning and error?

Anyway, this is legacy thing, right or wrong. Using "MustDeclareVars" option that script wouldn't run.

Last edited 7 years ago by trancexx (previous) (diff)

comment:4 Changed 7 years ago by Valik

You assume that I will get the same results. I may not get the same results so without you explicitly providing the error message we may end up talking about two different things.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.