8.5

Table Of Contents
FunctionName()
Some functions require you to put an "argument" (a parameter or variable) in the
parentheses after the function name, and others require you to leave the parentheses
empty. You should always include the parentheses, regardless of whether they contain
anything.
Functions that require parameters
Some functions require you to put a parameter or variable into their parentheses. When
you insert a parameter or variable into a function's parentheses, it's called "passing" that
parameter or variable to the function. For example:
Box1.Append(IntVar)
In this expression, the value of the variable IntVar is passed to the function Append. The
Append function, in turn, operates on that parameter by placing it in the Text Box object
named "Box1".
Functions that return values
Some functions are designed to perform a calculation or determine the condition of an
object. Such functions create information, such as the result of the calculation or the state
of the object. When one of these functions is finished executing, it "returns" this
information.
For example, consider the function named Number.sqrt(). This function calculates the
square root of any value you pass to it. For example, if you want to find out the square
root of the number 25, you could indicate this as "Number.sqrt(25)".
However, "Number.sqrt(25)" is not a complete expression, because it doesn't tell an
interactive presentation what to do with the returned value (the square root of 25, or 5).
To create a complete expression, you have to tell the interactive presentation where to
place the information.
One way to do this is to place it into a variable:
IntVar = Number.sqrt(25)
After this expression has been evaluated, IntVar will be equal to 5.
Why does this function start with Number? In this case, Number simply indicates that this
function is a numerical function. For more information, see "Objects."
Objects
Some functions require an "object" (something to act upon). Such functions may either
change the state of the object or retrieve information about it. These functions are referred
to as "object functions" or "methods." For such functions, we use the following syntax:
objectName.functionName()
Object functions work just like other functions. We've already looked at this example:
A GUIDE TO QUARKXPRESS 8.5: PLUS EDITION | 319
INTERACTIVE LAYOUTS