Ok, this is a simple mistake to make, but it is a lesson to be learnt.
Please look at the scope of TPCSetter, it is defined within the
If Block, and so it only exists within the
If block.
---------------------------------------------------------------------------
Problem solved? Possibly Not!
The problem (And Im only assuming this from you indentation), is that you have ended the
If block too early.
I think what you wanted to do was run the second
if, only if the first
if was true.
In this case the closing brace } for the first
if should be at the end, and not after the TPCSetter decleration.
In this way TPCSetter will still only have scope in the
ifblock, but the second
if will also be in this block
---------------------------------------------------------------------------
Obviously this is just an assumtion of mine, but eitherway you need to make sure that TPCSetter is defined at a high enough scope to contain both the if statements.
If my assumption was wrong, then as you have done in simply moving TPCSetter to outside the ifs will be enough.
H&K