First off, let me send out a big juicy "high-five" to Nml and Mindles for their awesomeness and help in the past.. I have learned a lot from these 2 guys.. they really know their stuff! (okay, not so much "juicy" but, how about a nice chilled 6-pack of their choosing?

And now...
Without getting into the psychcology (did I spell that right??) of the matter here... I am OCD.. and that is why the following occurred...
I recently was given some "suggestions" on new features for the website- including "auto podcast and archive creation" for my shows.
thats a GREAT idea!
So, I begin to "patch" some custom code I wrote.. and then *BAM*; I really BREAK it good.. so a rewrite is in order..
At this point, I decide to let a friend, who is a "expert programmer" have a peek inside.. The next thing I know, I'm hit with a barrage of all the things I'm doing wrong- without being told how to do them right.. of course, this person doesn't know TCL persey.. but he said "its much like C"... okay, fine... NOW the OCD kicks in.. (I do wonder if he did this as a form of torture?? HA HA HA HA)
One of the things he DID say, however, was that using "string matching" instead of integers was (in his words) "A BIG MISTAKE" and that I should use interger matching instead..
example: (what he suggests)
Code: Select all
if {($DetIA == "1")} {
putlog "Det A is ON"
}
Code: Select all
if {($DetIA == "onair.gif")} {
putlog "Det A is ON"
}
but now I hit the "big snarfu" where I have to convert these integers into their "onair.gif" and "offair.gif" notations respectively.. but 2 major problems came up right off the bat..
first one.. having to convert 20+ varables "on the fly" for EACH cycle that the output loop runs.. I see 20+ "if statements" here... that will run once per second; I fear that can be somewhat inefficient or CPU-intensive?
Code: Select all
if {$DetIA == "1"} {
set DetIA "onair.gif"
} else {
set DetIA "offair.gif"
}
second problem.. the varables here are GLOBALS.. so they change EVERYWHERE.. including in the OTHER loops! Now, when the "parsers" loop runs once every 10 seconds and the "output" loop runs every second, for every 9 seconds, the "parsers" loops will see INVALID values!
(they see "onair/offair" instead of "1/0")
This, of course, BREAKS the parsers loop!
So, now one thinks "okay just rename all the globals- so that you can use "locals" in the output convertions.." right?
NO again!
Since these values are parsed INSIDE the website.. I HAVE to use them or fear rewriting everything in the website; OR.. add a new global for each local varable to "match" it... MESSY!
So, my first question to ask...
"is it better to match integers instead of strings as logical values? OR does it not really matter in this case... "
The EASIEST thing I can do, is to go and convert back the "output detect" varables to "onair.gif" and "offair"gif" as I've always used.. but, I also would like to do thiings "the right way", too..
a side note:
Sure, I would like to post the code here, but its 2200 lines! (not counting the "wrap-arounds"...) so I apologize if this is confusing to some.. also, posting in sections wouldn't work either since the loops are inter-twined and linked via the globals respectively.. means you'd have to see the whole thing anyways to follow along.

the second question:
"if using integers will make a considerable dfference here, and that its "the preferred way" (yes, I purposely put in two conditionals here) whats the best way to handle the output situation?"
I have more Q's coming in the near future.. and, perhaps, maybe I can commission Nml/Mindles to rewrite this thing? its probably a piece of [choclate] cake for them! YUM!
Let me thank everyone in advance, for any coments and suggestions on how I can get this thing up and running in as effeciently as possable

-DjZ-

