RE: Pete: Your question
- Posted by Matt Lewis <matthewwalkerlewis at yahoo.com> Nov 04, 2003
- 540 views
<much snippage> Al Getz wrote: > > Hello again Pete, > > I believe you are over simplifying the 'generic' solution. > Your constants 'input' and 'output' make it seem like these > will be the only two constants ever needed, but that's not > the case at all. Instead, they should be renamed to > Instance1 and Instance2. This makes it a little more > clear that if a third instance needs to be taken out, > you'll have to go back into the test.e file and take > out another constant 'Instance3', plus change the length > of the sequence x to 3 instead of 2. Not only that, > these have to be global variables which adds to the > global clutter of variables in the program. > This is taken care of with the 'include new' approach, > and also in the substitute code i presented, but not > in your code. Your code doesnt automatically take > care of this, so it cant be the same in five lines either. Al, I think you've missed the point. If you want to *dynamically* have multiple instances of variables, then the id-sequence way is really the only way to do it (see Win32Lib, or any other lib that allows multiple instances of things). If you only have a couple (and you know at compile time how many you need) then you should probably copy the file to a separate name, and include them under separate namespaces. Matt Lewis