Modify

#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, on Jul 25, 2012 at 5:43:26 PM

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@…>, on Jul 26, 2012 at 11:36:10 AM

  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, on Jul 26, 2012 at 12:31:21 PM

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 on Jul 26, 2012 at 12:31:42 PM by trancexx (previous) (diff)

comment:4 by Valik, on Jul 26, 2012 at 5:00:41 PM

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.