Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Scope block command to hide variables


  • Please log in to reply
No replies to this topic
Tuncay
  • Members
  • 1945 posts
  • Last active: Feb 08 2015 03:49 PM
  • Joined: 07 Nov 2006
I would find it useful to have a scope command, in which all declared variables exists only in the named one. This could help us hiding variables and data.
x = 10
Scope, Name
{
  global x
  i = 0
  Loop, %x%
    i++
}
MsgBox %i% ; i = 0
MsgBox % Name::i ; i = 10
; or that way
Scope, OutputVar, i, Name
MsgBox %OutputVar% ; i = 10
I am not sure how complicated to implement this request would be.