Modify ↓
Opened 15 years ago
Closed 15 years ago
#1812 closed Bug (No Bug)
AutoItSetOption("MustDeclareVars",1) not working fully
| Reported by: | Rackbrane | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.6.1 | Severity: | None |
| Keywords: | Cc: |
Description
Despite the MustDeclareVars option being set to 1, an undeclared variable is allowed when used as a For loop index.
AutoItSetOption("MustDeclareVars",1)
For $Undeclared = 1 to 2
Send("Echo " & $Undeclared & @CRLF)
Next
Attachments (0)
Change History (3)
comment:1 by , 15 years ago
comment:3 by , 15 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

According to the help file for a For...Next loop:
'The Variable will be created automatically with a LOCAL scope, even when MustDeclareVars is on.
'
So, it's not a bug, it's a documented feature.