Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Invoke Methods
Topics
Topic |
Detail |
See also |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Access |
On the Workbench window, right-click on the instance on which to execute a method, and select the Invoke context menu option. |
|
||||||||||||
Choose Method |
A list of methods for the type are presented in a dialog; select a method from the list and click on the Invoke button. Note that all methods listed are public; private methods are not available.
|
|
||||||||||||
Supply Arguments |
In the example, the instance or variable Rob has been created, of type MyClassLibrary.CRobert, and the method AddFriends invoked that takes an array of CPerson objects as its only argument. You now supply to it three other Workbench instances: Fred, John and William. |
|
||||||||||||
Arguments |
In the dialog above, type any parameters required by the constructor:
Surrounding strings with quotes is unnecessary as anything you type for a string argument becomes the value of the string; for example, the only time you should surround strings with quotes is in supplying elements of a string array, or where the string is equal to the name of an existing workbench instance. "A b c" "a b $ % 6 4" A b c d As 5 7 ) 2 === 4
Enter the elements that compose the array, separated by commas: Type Arguments String( ) one,two,three,"a book","a bigger book" CPerson( ) Tom,Dick,Harry
If you enter text that matches the name of an existing instance, surround it in quotes to avoid the debugger passing the instance rather than a string.
|
|
||||||||||||
Invoke |
Having chosen the constructor and supplied any arguments, click on the Invoke button to create the variable. Output confirming this action is displayed in the Debug window.
|
Learning Center topics
· | (Alt+F1) | Enterprise Architect | Execution Analysis | Object Workbench | Invoke Methods |