GPDL Function Calls

DungeonCraft Help Home

A GPDL statement can consist of a 'naked' call to a function. Example:

  RemovePotions ( "Healing" );

The 'RemovePotions' function returns a value ( all functions do ) but that value gets discarded. 'Naked' function calls like this are common. But it is not legal to have a 'naked' expression as a statement:

  "xxx" + $RANDOM(3);  // ****Illegal*****

A function call may be used anywhere a quoted string might be used in an expression. The value returned by the function is used to evaluate the expression. Naturally, a function call can *NOT* be used on the left side of an assignment statement.

When calling a function, you must supply exactly the number of parameters as are declared in the function's definition or prototype. The actual parameters are supplied to the function as 'call-by-value". This means that the function can manipulate its parameters but the changes will not be passed back to the calling function.