Custom Functions

Each SDL script can contain custom functions much like UNIX shell scripts and C functions. A function can appear in any part of an SDL script. You define a function by specifying:

Example 22.8. Function Definetion

Name(Parameters) {
    [statements]
}


For example, here is a function definetion which accepts two arguments and prints each in a seperate debug call:

Example 22.9. Simple Function Definetion

PrintMyArgs(String_t $Str1, String_t $Str2) {
    Debug("Arg1 is $Arg1");
    Debug("Arg2 is $Arg2");
}