Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 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 by Valik, 14 years ago

Resolution: No Bug
Status: newclosed
  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 by MrCreatoR <mscreator@…>, 14 years ago

  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 by trancexx, 14 years ago

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 14 years ago by trancexx (previous) (diff)

comment:4 by Valik, 14 years ago

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.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.