You can create functions and methods by clicking the Add Function/Method icon (). The function/method is written in the Knowledgeware language (for more information concerning this language, see the Knowledge Advisor User's Guide) allowing you to:
Specify the function/method name
Specify its notation (function/method)
Specify its arguments using Knowledge types
Specify its return type
Specify its behavior either in the Knowledgeware language or in Visual Basic.
Those Knowledge functions are made available to all objects relying on the Knowledgeware language. They are displayed in the Knowledge browsers and can be used if:
They have just been created
The index has been re-generated.
For more information concerning this index, see the Infrastructure User's Guide.
The Function/Method creation window is broken down into 2 main parts:
The top part is designed to declare the function or the method and to determine how it is going to appear in the Knowledge Dictionary (Name, Return Type, Input).
The lower part is designed to let you describe the behavior of the function/method.
Allows you to add a comment or a URL to the method/function. | |
Allows you to access the syntax error. | |
Allows you to enable or disable the automatic indentation in the body editor. | |
Allows you to erase the function or the method body from the body editor. | |
Allows you to access the Knowledge Browser containing the Knowledgeware Index. All Knowledge types, attributes, functions and methods can be used in the body editor. |
Declaration in the Knowledge Dictionary | Shows the signature as it will appear in the Knowledge Browser. |
Method/Function name | Displays the name of the function or method. This name must be unique in the .CATfct Document and in the index which cannot contain 2 functions or methods with the same name or the same arguments. You can use the browser to make sure that the name does not already exist. |
Method/Function Selection | Enables you to determine if you want to create a method/function. |
Method type | If you create a method, this field enables you to
declare the type of object to which the method will apply. This type must
be a type available in the Knowledge Dictionary. Click the ...
button to select a type. This type can be a complex type like a hole or a
pad. For more information, see Creating a Function below. Note that this object can also be accessed in the method body using the This keyword. |
Argument(s) | Enables you to specify the arguments (their types and
names) of the function/ method. To do so, click the ... button
to select a type in the Knowledge Browser. This type can be:
|
Return type | Enables you to choose the return type of the
function/method. To do so, click the ... button to select a
type in the Knowledge Browser. This type can be:
|
Variables | This field lists the inputs and outputs of the function/method. If you click an item in this field, it is automatically pasted into the editor. |
Body Editor | The body editor allows you to describe the behavior of the function/method. This behavior can be made up of local variables, keywords, input/output variables, attributes and methods or functions. You can use the Knowledge Browser to define this behavior. |
In the Technological Object toolbar, click the Add Function/Method icon ().
Enter the name of the method that you want to create in the Name of Interactive Function field.
Click the ... button and select the Method Type field.
Click the ... button in the Return Type field and select the type that will be returned in the Choose Type Argument dialog box.
Click the ... button in the Argument(s) field. The Choose Type Argument dialog box is displayed.
Enter the name of the argument in the Name of Argument field.
In the Type of Argument frame, select the type that you want to select (Complex type which is the type selected by default or Simple type) and select the type from the list. Click OK when done.
Click the ... button in the Return Type field. The Choose Type Argument dialog box is displayed.
Select the type of type that you want to select (Complex type which is the type selected by default or Simple type) and select the type from the list. Click OK when done.
Enter the body in the editor.
In the Technological Object toolbar, click the Add Function/Method icon ().
Enter the name of the function that you want to create in the Name of Interactive Function field.
Click the ... button in the Return Type field and select the type that will be returned in the Choose Type Argument dialog box.
Click the ... button in the Argument(s) field. The Choose Type Argument dialog box is displayed.
Enter the name of the argument in the Name of Argument field.
In the Type of Argument frame, select the type that you want to select (Complex type which is the type selected by default or Simple type) and select the type from the list. Click OK when done.
Click the ... button in the Return Type field. The Choose Type Argument dialog box is displayed.
Select the type that you want to select (Complex type which is the type selected by default or Simple type) and select the type from the list. Click OK when done.
Enter the body in the editor.