Functions

Functions are defined in your script as shown in this example:

<codedoc> Function IsItemASword( $itemNum ) {

if ( $itemNum = 112 )		// Sword
{
	return( 1 )
}
else if ( $itemNum = 113 )	// Sword 2	
      {
	return( 1 )
}
return( 0 )

} </codedoc>

This example function would be called from another part of your script like this: <codedoc>

$isSword = IsItemASword( $gTaskItem1 )

</codedoc>

Functions can have any number of parameters, and always return a value.