Click to See Complete Forum and Search --> : Back to the beginning


Burrow
04-20-2003, 05:13 PM
hmm...

A triumphant day occured yesterday. I was able to put all the tiny little scripts (working individualy) into the mother of all scripts I've ever made, and when I tried it out, it didn't work.

That makes me very very sad. :(:(:(


Anyway, my main problem seems to be variables in general.

So, I'm going to put down what I know about variables and would like people to just tell what they know about variables if I already don't have it down.

Here goes:

• Variables set outside of a function are automatically global (Not 100% on that one).

• Variables set within a function have the following attributes.
- If using (var) in front of the variable then it is local
and only accessable via THAT function.
- If not using a (var) in front of the variable then it
becomes global and is able to be used by other
functions.

• Setting a variable is done by using the var "Varable name".
• Variable Names can only contain Letters, Numbers, and
Underscores
• The variables Dog, DOG, dog, DoG, dOg, DOg, dOG are all
different variables.
• You call variables by placing their name within a JavaScript.
• You can only send variables between pages using forms or
cookies.
• Global Variables are set for the Entire Script.
• Local Variables are used for only that script.

That is basically the basics of variables, now I want some more info about variables.

How are they transferred.
Are they usable both between functions and non-functions
How do they replace one another.
Just ANYTHING!!

Any and All Help is appreciated.
Thanks.

Jona
04-20-2003, 05:22 PM
Variables can start with letters, underscores, but not numbers. Example:

Correct: var xpr;
Correct: var _xpr;
Incorrect: var 12xprs;

:) But you probably already knew that... ;)

Burrow
04-20-2003, 05:46 PM
Yeah, but it can still help me review the rules of variables. :D

Burrow
04-20-2003, 06:52 PM
:) ,

I was sort of hit and miss on some of those.
Oh well, it's better for me to learn all I can about them, they seem to be very tricky, or it could be I haven't had to learn them for around a year or so... either way.

Thanks for variable info.