----- Original Message -----
From: "Loren" <[EMAIL PROTECTED]>
> Thanks Jon,
> I saw the function part and . . . well expected it to . . you know. .
> function! (didnt quite understand your answer)
A function is a piece of code that carries out some useful function when you
"call" it. Until you call it, it just sits there and does nothing. To call
it, you either assign its return value (if it has one) to a variable, or
simply call the function by writing its name and drop any return value.
Example: if you put this in your program:
function makeSquare($x) {
return $x * $x;
}
You made a new function called makeSquare(). Wherever you need the square
of a number in the rest of your program you can put in the line
print makeSquare($thisnumber);
Now you have called the function so its code gets executed. Or you might
put:
$squareOfNine = makeSquare(9);
and $squareOfNine would now have the value 81. You could even write:
makeSquare(9);
and the function would calculate the return value which would then be
discarded. Sometimes functions are called that way when their code does
something useful and you don't need to know the result.
But until you call makeSquare() in one of these ways, its code would sit
there and do nothing at all. So if you have put code that you want to do
something inside a function, either call it, or take it out of the
function() { } wrapper and make it part of the program.
Bj
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
http://wdvl.internet.com/WDVL/Forum/#sub
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]