newbie -why doesnt this work???

int a = 0;
int b = 0;
int c = 0;
long p = 0;
long time = millis();
void setup() {
pinMode(0,INPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);

}
void loop() {
int x = analogRead(0);
if(7 < c < 13) digitalWrite(7,HIGH); else digitalWrite(7,LOW);
if(17 < c < 23) digitalWrite(8,HIGH); else digitalWrite(8,LOW);
if(x > 300, a == b) c = time - p;
delay(1);
if(x > 300, a == b) long p = time, b = 1;
if(x < 300, a != b) b = 0;

}

im trying to read the frequency of an analog pin in order to determine the output pin. at 50hz, digitalpin 8 should be high and at 100hz, digital pin 7 should be high. can anyone explain why this doesnt work?

Your description doesn't really make any sense and neither does your code. Try packing less on individual lines of your code, adding comments, and using variable names that make sense to a reader (other than you).

One thing that seems like a mistake is that you never change the variable time. It gets loaded with the value of millis() when the sketch first starts and then never gets changed again.

ok. i just need to measure the frequency of an input signal.

http://arduino.cc/en/Reference/PulseIn

if(7 < c < 13) digitalWrite(7,HIGH); else digitalWrite(7,LOW);
if(x > 300, a == b) long p = time, b = 1;

C doesn't support this kind of compound conditional statement (the syntax is "legal", though I'm surprised that it didn't cause warnings. But it almost certainly is not doing what you expect.) try

if (c > 7 && c < 13) ...;
if (x > 300 && a == b) ...;

Also remove the "long" in that statement; that will allocate a new instance of "p" instead of using the global copy.

Those are just the C-level errors; I'm not sure how you think your code is detecting the period of the signal on analog pin...

Where is your

void Setup() file?

To debug I use Serial.print( object )

It will allow you to observe certain variables