Modify

#2517 closed Feature Request (Rejected)

MustDeclareVars=1 as default

Reported by: Raik Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

Because i stumbled over scripts again and again, throwing "variable used without being declared" over and over, i suggest MustDeclareVars=1 as default value, to get newbies learning a clean programming-style right from the start.
AutoIt anyway does not accept undeclared vars anymore, so its better to set this option on by default (and possibly remove it).

Attachments (0)

Change History (5)

comment:1 by TicketCleanup, on Oct 29, 2013 at 8:00:02 PM

Version: 3.3.8.1

Automatic ticket cleanup.

comment:2 by Matt Diesel, on Oct 29, 2013 at 8:32:29 PM

AutoIt does still allow you to directly assign to undeclared variables, for example the following is still perfectly valid code:

$a = "Hello"
MsgBox(0, "Test", $a)

But running with Opt("MustDeclareVars", 1) won't work.

Changing it to the default would break any old scripts that relied on this functionality, and I can't really think of an example where using this option would show something that is not obvious and isn't shown by Au3Check already.

comment:3 by J-Paul Mesnage, on Oct 31, 2013 at 6:00:52 AM

Perhaps a good way is to have Au3Check default enforcing this verification.

I assume a lot of designer use SciTE

comment:4 by James, on Oct 31, 2013 at 11:50:18 AM

Absolutely not. You're imposing restrictions on developers for no reason other than selfishness.

What might be a good idea is to instead set the default AU3 template to set MustDeclareVars, but not do it by default. It's nonsensical to turn it off, rather than on.

Last edited on Oct 31, 2013 at 1:09:42 PM by James (previous) (diff)

comment:5 by James, on Nov 4, 2013 at 7:55:10 AM

Resolution: Rejected
Status: newclosed

I'm marking this as closed since there has been no further responses.

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.