View Single Post
02/03/15, 10:34 PM   #5
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by Sasky View Post
That's risky since you can be inconsistent using different values. The other thing to think about is that function calls have overhead, even if they don't have to communicate with the server, so you'd want to avoid calling more than once.
Sasky is right, I didn't make that very clear: the "different values" Sasky mentioned was what I was referring to when I said if the values can change as your code is running and you need an up to date value then call it again.

I really meant different parts of your code/addon/functions possibly, that may run at different times. You may need an up to date value if something has changed. Like in your question: if you were grabbing that audio setting when your addon loaded, but "later" you wanted to do something with it, the user or an addon may have changed the audio setting since last time you grabbed it so you would probably need to get that value again to make sure your working with the correct value.
  Reply With Quote