I'm trying to call a function found elsewhere on this site to replace a character defined in a string, but whenever I try it, it tells me:

Script error: expected expression !

Sample script follows:

$Test = "This is a test"
$Change = "t"
$Text = "k"

$newdata = Replace($Test,$Change,$Text)
Exit

Function Replace($SourceString,$ChrToReplace,$ReplacementChr)
...code here
EndFunction

It fails trying to call the function. What simple thing am I missing?