View Single Post
02/03/15, 02:34 PM   #1
DrGerm
 
DrGerm's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 2
Question Which way should I display a value gained from a constant?

OK, complete newb here (no programming experience whatsoever). The following is in the context of displaying the value of a Constant value to chat, but I think this is a general question about getting and displaying stored values. I will eventually be doing a little more than just printing the actual number to chat.

Should I do:

Example 1:

local currentMasterVolume = GetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_AUDIO_VOLUME);
d(currentMasterVolume)
or Example 2:

d(GetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_AUDIO_VOLUME))
Both of these work when I test them. I've seen examples in other addons like Example 1, but Example 2 seems simpler. However, I have a feeling that I'm missing something about how to code correctly.

Thanks!
  Reply With Quote