expected primary-expression before '=' token

I've been doing a bit more "learning by doing" supported by Simon Monk's 2 books, and have hit a snag that I don't seem to be able to find my way around. I started by testing some code in single passes in the void setup function, and it worked fine, but now I've moved it to void loop and added the elapsed time test, it fails at the line:
ctVolts[n] = analogRead(ctVoltPin); // Read the sample voltage from the CT
with a string of errors
sketch_RMS_2nd_step.ino: In function 'void loop()':
sketch_RMS_2nd_step:42: error: expected primary-expression before '=' token
sketch_RMS_2nd_step:42: error: expected primary-expression before ')' token
sketch_RMS_2nd_step:42: error: expected `;' before ')' token

Here's the code:

[quote]
[color=#7E7E7E]// sketch RMS Second Step[/color]

[color=#7E7E7E]// It seems that the maths is ok in principle. Need to centre the dc on A0[/color]
[color=#7E7E7E]// and check the division factor to read actual volts.[/color]
[color=#7E7E7E]// Moving the working code into loop() and changing the for loop into nested ifs[/color]
[color=#7E7E7E]// has broken it.  I think there is a primary expression before "=" but clearly[/color]
[color=#7E7E7E]// something is causing the compiler to conclude otherwise.[/color]

[color=#CC6600]const[/color] [color=#CC6600]byte[/color] PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
[color=#CC6600]const[/color] [color=#CC6600]byte[/color] PS_16 = (1 << ADPS2);
#define ctVoltPin = A0;
[color=#CC6600]float[/color]   ctVolts[40];
[color=#CC6600]float[/color]   ctTotal = 0;
[color=#CC6600]float[/color]   ctRMS = 0;
[color=#CC6600]long[/color] timeNow   = [color=#CC6600]micros[/color]();
[color=#CC6600]long[/color] timeStart = [color=#CC6600]micros[/color]();
[color=#CC6600]int[/color] n = 0;

[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()
{
  ADCSRA &= ~PS_128;  [color=#7E7E7E]// remove prescale of 128[/color]
  ADCSRA |= PS_16;    [color=#7E7E7E]// add prescale of 16 (1MHz)[/color]
  [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]begin[/color](9600);
  [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]([color=#006699]"Starting Test"[/color]);
}  
[color=#CC6600]void[/color] [color=#CC6600][b]loop[/b][/color]() 
{
     [color=#CC6600]if[/color] ((timeNow - timeStart) > 4999); [color=#7E7E7E]// Has 5mS elapsed?[/color]
 { 
       timeStart = timeNow; 
       [color=#CC6600]if[/color] (n = 39) [color=#7E7E7E]// Start again with the first array element - sample [/color]
     {
        n = 0;                                [color=#7E7E7E]// Reset the array element counter[/color]
        ctRMS = [color=#CC6600]sqrt[/color](ctTotal/40);             [color=#7E7E7E]// Calculate the mean of the total of the samples[/color]
        [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]([color=#006699]"Sum of squares = "[/color]);    [color=#7E7E7E]// and publish the results[/color]
        [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color](ctTotal);
        [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]([color=#006699]"The RMS of which = "[/color]);
        [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color](ctRMS);
     }
          [color=#CC6600]else[/color] [color=#CC6600]if[/color] (n < 39)                    [color=#7E7E7E]// Count through the sample storage array[/color]
        {
          ctVolts[n] = [color=#CC6600]analogRead[/color](ctVoltPin); [color=#7E7E7E]// Read the sample voltage from the CT[/color]
          ctVolts[n] = ctVolts[n]/100;        [color=#7E7E7E]// Convert the sample to real Volts - the correct value needs to be determined[/color]
          [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]([color=#006699]"Array element No. "[/color]);
          [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color](n);
          [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]([color=#006699]" = "[/color]);
          [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color](ctVolts[n]);
          [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]([color=#006699]" Volts"[/color]);
          ctVolts[n] = pow(2, ctVolts[n]);  [color=#7E7E7E]// Square each sample in the ctVolts array[/color]
          ctTotal    = ctTotal + ctVolts[n]; [color=#7E7E7E]// Total up the samples squared[/color]
          n = n + 1;  [color=#7E7E7E]// Step to the next array element [/color]
       }
  }
}

[/quote]

I know there are libraries out there that contain code to do stuff like this, but I'm at an early stage with Arduino, and want to practice on things I'll have a use for, not just incorporate others work.
Can anybody spot the cause?

Perhaps all those [Color= tags?

@Slow-Learner, as you have discovered, Copy for Forum does not mix well with code tags. Newer versions of the IDE fix the problem.

Code without the BBS tags...

// sketch RMS Second Step

// It seems that the maths is ok in principle. Need to centre the dc on A0
// and check the division factor to read actual volts.
// Moving the working code into loop() and changing the for loop into nested ifs
// has broken it.  I think there is a primary expression before "=" but clearly
// something is causing the compiler to conclude otherwise.

const byte PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
const byte PS_16 = (1 << ADPS2);
#define ctVoltPin = A0;
float   ctVolts[40];
float   ctTotal = 0;
float   ctRMS = 0;
long timeNow   = micros();
long timeStart = micros();
int n = 0;

void setup()
{
  ADCSRA &= ~PS_128;  // remove prescale of 128
  ADCSRA |= PS_16;    // add prescale of 16 (1MHz)
  Serial.begin(9600);
  Serial.println("Starting Test");
} 
void loop()
{
     if ((timeNow - timeStart) > 4999); // Has 5mS elapsed?
 {
       timeStart = timeNow;
       if (n = 39) // Start again with the first array element - sample
     {
        n = 0;                                // Reset the array element counter
        ctRMS = sqrt(ctTotal/40);             // Calculate the mean of the total of the samples
        Serial.print("Sum of squares = ");    // and publish the results
        Serial.println(ctTotal);
        Serial.print("The RMS of which = ");
        Serial.println(ctRMS);
     }
          else if (n < 39)                    // Count through the sample storage array
        {
          ctVolts[n] = analogRead(ctVoltPin); // Read the sample voltage from the CT
          ctVolts[n] = ctVolts[n]/100;        // Convert the sample to real Volts - the correct value needs to be determined
          Serial.print("Array element No. ");
          Serial.print(n);
          Serial.print(" = ");
          Serial.print(ctVolts[n]);
          Serial.println(" Volts");
          ctVolts[n] = pow(2, ctVolts[n]);  // Square each sample in the ctVolts array
          ctTotal    = ctTotal + ctVolts[n]; // Total up the samples squared
          n = n + 1;  // Step to the next array element
       }
  }
}
     if ((timeNow - timeStart) > 4999); // Has 5mS elapsed?

Stripping out the color crap, you have this. If the time has passed, do nothing - that's what the ; does. Otherwise, do nothing. Why bother testing?

This is the reason for the compilation error...

#define ctVoltPin = A0;

Change it to this...

const byte ctVoltPin = A0;
if (n = 39) // Start again with the first array element - sample

This code needs to be fixed too.

#define ctVoltPin = A0;

Oops

Thanks for your suggestions folks. I'll work through them, but a couple I can comment on immediately. The colours tags were added by the hash button copy process - nothing to do with the original code. I downloaded the IDE about a month ago so assumed it was the latest but I'll check for updates. The #define worked fine in the single pass version, and the if statements all have code following. The test for 5mS elapsed time was intended to cause the sketch to loop until the next 5mS interval has passed. Ultimately there will be other things going on in that time, but for now it was meant to just loop. Anyway as I said, I'll check out each suggestion in turn in the morning. Many thanks.

The syntax for the #define does not require an = sign.

There is nothing wrong with using the #define without an = sign .

Special thanks to Coding Badly and AWOL; it was the #define what did it. I'll have to ensure that I limit its use to purely numeric global constants, or avoid it altogether which would beg the question, is it of any value?

For defining constants? Not really.

It's often a bad idea to put a semicolon at the end of a #define too.

Oh, and thanks to KevinAnderson too for highlighting that I'd fallen into the = trap. Testing == , setting =. Duh!