You can create script functions that need arguments in the input. In the script function, you use #1 to retrieve the first argument in the input, #2 to retrieve the second argument, and so on.You can also declare arguments to a function as local variable names. See Using local variable names as arguments to a function.
Example 34 func FileNameString ()
{
$namestring = #1 + "_" + #2;
return $namestring;
}In this example, the script function FileNameString uses two input arguments to create the string “customer name_invoice number”.$nameAndNumber = FileNameString (&yourReference, &invoiceNumber);If &yourReference is Mike Jones, and &invoiceNumber is 1020, the value of $nameAndNumber is “Mike Jones_1020”.
Example 35 func ChangeDateFormat ()
{
$month = #1(1,2); //Character 1 and 2 in input string
$day = #1(4,2); //Character 4 and 5 in input string
$year = #1(7,4); //Character 7 to 10 in input string
$newformat = $year + "-" + $month + "-" + $day;
return $newformat;
}In this example, the script function ChangeDateFormat changes the date format mm/dd/yyyy to yyyy-mm-dd.$dateFormatSWE = ChangeDateFormat (&invoiceDate);
OpenText StreamServe 5.6 | Updated: 2013-03-01 |