A function file is a text file containing user created script functions. The example below shows a function file with four user created script functions. Each script function in this example returns a specific RGB-value.
CodePage UTF8//Returns dark orange (RGB 255,101,0)
func OrangeDark ()
{
return RGBcolor(255,101,0);
}//Returns light orange (RGB 255,154,0)
func OrangeLight ()
{
return RGBcolor(255,154,0);
}//Returns dark blue (RGB 0,0,255)
func BlueDark ()
{
return RGBcolor(0,0,255);
}//Returns light blue (RGB 99,207,255)
func BlueLight ()
{
return RGBcolor(99,207,255);
}A function file is a resource that you must add to the appropriate resource set. This means you can create the function file directly from the resource set, or import an existing function file.You call a user created script function the same way as you call a built-in script function (SetDestPath, CallProc, etc.). For example, if you have a script function called setArea, you can call this function from a script:$area = setArea($length, $width);You can create functions that return values. The function example below returns the RGB value 255,154,0:func OrangeLight ()
{
return RGBcolor(255,154,0);
}$color = OrangeLight ();You can also create functions that do not return values. The function example below includes the SetDestPath script function:func setInvoicePath ()
{
SetDestPath(&invoiceNumber + "_" + &yourReference);
}setInvoicePath ();
OpenText StreamServe 5.6 | Updated: 2013-03-01 |