Re: [chirp_devel] [resolved] Inverted Boolean Help Needed
21 Jan
2014
21 Jan
'14
1:14 p.m.
I figured out what the issue was. Apparently I was reading the wrong value, inverting it and then stuffing it into the "beep_tone" setting.
Jim KC9HI
On Tue, Jan 21, 2014 at 3:30 AM, IZ3GME Marco iz3gme.marco@gmail.comwrote:
Don't have the time to test myself but I would check in the direction of type conversion: check the type of the variable and eventually replace "NOT" with appropriate comparision (eg == 0)
my two cents 73 de IZ3GME Marco
On 21/01/2014 04:09, Jim Unroe wrote:
On Mon, Jan 20, 2014 at 10:04 PM, Jens J. <kd4tjx@yahoo.com mailto:kd4tjx@yahoo.com> wrote:
Not that this fixes your specific problem, but I have run into a few different settings which have this sort of "inverted" logic. To keep things simple in the rest of the code, I just name the setting appropriately so that the logic in the rest of the program need not be inverted, e.g., name your setting foo_disable if value of True/1 disables foo, and foo_enable if True/1 enables foo. I think it makes it easier to read. "beep_tone" is a boolean? If I'm reading that "beep_tone_disabled" seems like it would be a much more meaningful name for the setting field.
Jens,
That makes sense. If I can figure out how to fix this, I can change that too.
Jim
3987
Age (days ago)
3987
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jim Unroe