if(serial) example

void setup() { //Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) { ; }} // wait for serial port to connect. Needed for native USB

void loop() { //proceed normally
}

This example was taken directly from the Learning/Reference/Serial/ if(serial) tutorial on the arduino WEB site.
Question: Where is the sentence if(Serial) in this example ?
Suggestion: Maybe, someone ought to correct that tutorial and give a legitimate example with the actual if(serial) command.

Regards

Jim

I don't understand your question. Why are you expecting to see if (Serial) ?

WHILE behaves like a repeated series of IFs

...R

Where is the sentence if(Serial) in this example ?

It isn't there and it isn't needed.

Where do you think you would need this?

I think the problem is that the link to that section should be named "while(!Serial)" - not "if(Serial)" - because if you are going to test for the presence/absence of the Serial port, you are far more likely to use while(!Serial) to wait for the port to start up.

Pete