Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Yet another variable question Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
ginigma
Senior Member
Senior Member


Joined: June 18 2006
Location: United States
Online Status: Offline
Posts: 127
Posted: February 16 2008 at 16:11 | IP Logged Quote ginigma

From a previous post of Dave's:
Quote:
The distinction between [LOCAL] and [TEMP] variables have become blurred in recent versions. Originally, you had 3 types of system variables, [LOCAL], [TEMP], and [GLOBAL] (not to be confused with a database global variable...a [GLOBAL] system variable is stored in memory only). [GLOBAL] variables were easy and were just as implied...global. They could be changed and accessed anywhere. [TEMP] variables were unique to the macro or formula but could be passed down to another macro or formula...never passed up. [LOCAL] variables were unique to the particular macro or formula and every new macro or formula got a fresh set. With the advent of plugins and triggers that need to pass a lot of data, the [LOCAL] always being a fresh set has changed somewhat. Since [TEMP] variables always could be inherited, these were the variables that were used to pass data to a called macro or formula from a trigger. Recently, we need to pass more data than is available for the [TEMP] variables so macros and formulas called from triggers (or plugins) can also inherit data in [LOCAL] variables.


I have a situation where some marcos are running simutaneously. If they are using the same variable names (meaning each macro is using [TEMP1] within its own macro) are they being stepped on? Can I safely use [LOCAL] variables which will not be stepped on? Or should I just use all different names of [GLOBAL] variables?

__________________
Insteon (40 devices) ^ PowerHome (435 links) ^ Logitech Harmony 880
Back to Top View ginigma's Profile Search for other posts by ginigma Visit ginigma's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: February 16 2008 at 17:17 | IP Logged Quote TonyNo

Each macro has its own LOCAL and TEMP variable space. You are safe.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
ginigma
Senior Member
Senior Member


Joined: June 18 2006
Location: United States
Online Status: Offline
Posts: 127
Posted: February 17 2008 at 15:42 | IP Logged Quote ginigma

Excellent! Thanks Tony.

__________________
Insteon (40 devices) ^ PowerHome (435 links) ^ Logitech Harmony 880
Back to Top View ginigma's Profile Search for other posts by ginigma Visit ginigma's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum