Methods

Now that you're comfortable working with classes, let's take a closer look at the methods. In case you skipped the quickstart section, it's worth pointing out again that to add arguments to a method you simply right click on the method's name and select "Add Arg." An argument and a variable act exactly the same, so we will cover the arguments later.


The main tab of the method notebook provides the basic information. You can change the name of the method itself, the return type, whether or not it's constant or a pure virtual, and some docs. It's worth considering briefly what the "Const" and "Pure Virtual" check boxes are for. In both cases they will add the little big of extra decoration to the end of the method declaration. Const will add the const keyword, and pure virtual will add "=0".


The next tab is the Code tab. This tab lets you fill in any code that you want to have included in the header. This is especially handy for small, accessor methods, but you can use it for whatever you want. Note that it's very specific about what you type in here. You will need to include the curly brackets {} and it will preserve all the tab and enter key pressed.