About Knowledgeware Functions and Methods    

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:

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:

For more information concerning this index, see the Infrastructure User's Guide.

Interface Description

The Function/Method creation window is broken down into 2 main parts:

Action Toolbar and Comments

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.

Function Declaration

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:
  • A basic type like a real or an integer
  • A magnitude like a length or a volume
  • A complex type like a hole or a pad
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:
  • A basic type like a real or an integer
  • A magnitude like a length or a volume
  • A complex type like a hole or a pad

Function Definition

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.

Creating a Method

In the Technological Object toolbar, click the Add Function/Method icon ().

  1. Enter the name of the method that you want to create in the Name of Interactive Function field.

  2. Click the ... button and select the Method Type field.

  3. Click the ... button in the Return Type field and select the type that will be returned in the Choose Type Argument dialog box.

  4. Click the ... button in the Argument(s) field. The Choose Type Argument dialog box is displayed.

  5. Enter the name of the argument in the Name of Argument field.

  6. 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.

  7. Click the ... button in the Return Type field. The Choose Type Argument dialog box is displayed.

  8. 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.

  9. Enter the body in the editor.

Creating a Function

In the Technological Object toolbar, click the Add Function/Method icon ().

  1. Enter the name of the function that you want to create in the Name of Interactive Function field.

  2. Click the ... button in the Return Type field and select the type that will be returned in the Choose Type Argument dialog box.

  3. Click the ... button in the Argument(s) field. The Choose Type Argument dialog box is displayed.

  4. Enter the name of the argument in the Name of Argument field.

  5. 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.

  6. Click the ... button in the Return Type field. The Choose Type Argument dialog box is displayed.

  7. 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.

  8. Enter the body in the editor.