AutoHotkey Community

It is currently May 27th, 2012, 1:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: March 15th, 2009, 12:49 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Lexikos wrote:
This is because variable declarations such as
I don't know if Chris and/or you see if the following as illegal so plans to forbid it, actually I'd like to have it as a feature as it's been done only once at loadtime, which I needed frequently even with the assume-static mode.
Code:
ftn(){
   Static
   Static  var := "val"
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2009, 4:32 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
Actually AutoHotkey_L originally did not support that (more as an oversight than a rule). Chris specifically allowed it for the same reason you've mentioned. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2009, 12:43 pm 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
Please don't quote original help document when discussing update. Although it might not be inaccurate without static mode that a dynamic variable in function should be local or global, with static mode been provided that paragraph might be required to be updated. Probably the problem would just be what the modification should be, static/ local, local/ static, static/ global, or global/ static, which probably should depend on the usage but not how current version works ~

_________________
Sakurako ^_^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2009, 1:05 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
What I quoted is no less accurate now than it was in previous versions.
Quote:
Within a function, any dynamic variable reference such as Array%i% always resolves to a local variable unless no variable of that name exists, in which case a global is used if it exists.
Quote:
Static variables are always implicitly local
When a variable is looked up at run-time (i.e. via a dynamic reference) the script does not distinguish between a static local variable and a non-static local variable.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group