motor code error

I am very new to code and all that I'm trying to do is to get the thing to spin. It is hooked up to an ESC and to the Arduino. When I try to upload it, it gives me this error on the first line:

sketch_jan04f:1: error: expected constructor, destructor, or type conversion before '.' token

Here is the code:

motor.attach(9)
motor.write(0)
motor.write(10)
motor.write(20)
motor.write(30)
motor.write(35)
motor.write(40)
motor.write(45)
motor.write(50)
motor.write(60)
motor.write(70)

Here is the code:

Every;
statement;
in;
C;
ends;
with;
a;
semicolon;.

It still gives me the same error even with the semicolons.
I am almost totally clueless about code
If you have any tips or improvements or suggestions on my code (above) please post a reply

It still gives me the same error even with the semicolons.

Then we need to see all of your code, not just a snippet.

That is the whole thing.
I'm completely clueless

That is the whole thing.
I'm completely clueless

I guess.

Every Arduino sketch has a setup() function and a loop() function, and all executable code goes in one of those functions, or some other function.

HOW AND WHEN DO I USE THESE FUNCTIONS?
I tried looking it up and I only got more confused. Could you also tell me where and how to use these functions in my code?

HOW AND WHEN DO I USE THESE FUNCTIONS?

The Arduino executes main() when powered up. The main() function calls init(), setup(), and loop(), in an endless loop. You don't have to use these functions. You just have to supply them.

There are dozens of sample sketches provided with the IDE that show how setup() and loop() are structured. Running some of them would show how they are used.

Is adding slashes and stars necessary?

Along with descriptions of each code or function

Is adding slashes and stars necessary?

No, but sometimes it can be useful. It's hard to multiply without stars and hard to divide with slashes.

Along with descriptions of each code or function

Not if you have a phenomenal memory. What were we talking about? 8)

I meant the little descriptions next to the code.

Also are you saying that the stars and slashes are for multiplying and dividing?

Also are you saying that the stars and slashes are for multiplying and dividing?

Yes.
Start looking at the example code found in the arduino IDE, that is the software you have running on your PC. Look in the File -> Examples menu to get started.
You are a way off being able to control motors yet until you learn the basics.

I created this code. Although it uploaded just fine without any problems, the motor would not spin. FYI It is hooked up to an ESC

#include <Servo.h>
Servo motor; // create servo object to control a servo

void setup() {
Serial.begin(9600);
motor.attach(9); //the pin for the servo control
}

void loop() {
motor.write(0);
motor.write(10);
motor.write(20);
motor.write(30);
motor.write(35);
motor.write(40);
motor.write(45);
motor.write(50);
motor.write(60);
motor.write(70);
motor.write(80);
motor.write(90);
}

arduinosoccer33k:
I meant the little descriptions next to the code.

Also are you saying that the stars and slashes are for multiplying and dividing?

I assume your original question refers to comments // or /* */

If those are unfamiliar, you might consider looking at some C/C++ tutorials as well as the examples provided with the IDE.

please help fix it to work with my servo motor

Also are you saying that the stars and slashes are for multiplying and dividing?

That's one use. The other, when they are use together is to start and end comments. Out of context, as your question was, the answers can go either way (or a host of other ways, for that matter). The point of my rather silly reply, was to get you to provide that context.

I meant the little descriptions next to the code.

int var = value; // Like this?

No, the comments (that's what they are) are not required. Often, they simply state the obvious. But, to a newcomer they explain what the code does. Of course, what is obvious to me and what is obvious to you are miles apart. So, you should provide them in code you share, so that we can see that your understanding of the code is correct.

I created this code. Although it uploaded just fine without any problems, the motor would not spin

Your code runs a couple of hundred times a second.
What do you expect it to do?

please help fix it to work with my servo motor

The person below seems to have the same problem as you do.

http://arduino.cc/forum/index.php/topic,140752.0.html

OP, please stop.
A banning beckons.