While Quorum has a bare-bones online compiler and output window on its home page for testing basic operations, in order to obtain a full-featured version of the language, we need to download and install a full Integrated Development Environment (IDE). To do this for Quorum, we go to the download page
, which contains links and instructions. Once Quorum is installed, we can create a Quorum project. While using Quorum offline is
optional, we recommend using it as projects increase in size.
Creating a Quorum project
Once we have installed Quorum, we can create a Quorum project in NetBeans. Quorum projects now come in four pre-configured templates, which are as follows:
- Blank Application: A new project with an empty source code file.
- Application: A new project with a default template for a basic Quorum Application with a main class and method.
- Game Application: A new project with a template for creating computer games with visual or auditory feedback.
- Lego Robot Application: A new project that uses a default template for controlling Lego robots.
Note that any of these projects can be expanded or re-configured to use any kind of Quorum features. These templates are included as a resource to help us get started, but as applications evolve they can be changed in whatever way is helpful. In other words, just because we started a Lego robots project does not mean we cannot use that project for other types of code.
To make any new project in the IDE, we follow these standard steps:
- Load up NetBeans (or Sodbeans, which is the same thing, except the Quorum and Accessibility plugins are loaded by default). On a Mac, a default environment looks like this:
- If this is our first time loading NetBeans, Quorum includes a variety of accessibility options that can be set. By default, sighted users generally do not want self-voicing turned on, but blind users might, depending on their preferences. This window looks like the following:
- We go to the file menu with the keyboard shortcut (CTRL + N or SHIFT + APPLE + N) or can use the mouse to select New Project.
- There are two panes in this window (shown below). The left pane provides project templates for a variety of programming languages or technologies. We want to select Quorum, using either the keyboard or the mouse.
- Once Quorum is selected in the left pane, the right pane will change to show all of the available Quorum projects that can be created.
Running or Debugging a Quorum program
Once we have created a new project, we can type code into in the editor window of our project, which we can get to with either the mouse or the keyboard shortcut (CTRL + 0 on Windows or APPLE + 0 on Mac). Once there, we can type code like the following:
output "Hello, World!"
To run a program, we can either press the green button on the top bar of the program, which looks like a play button on a remote control, or we can navigate to the Run menu and select Run Project (hotkey is F6 by default). The following shows an image of the run and debug buttons:
To debug a program, the steps are similar. Normally, the purpose of debugging is to temporarily halt a program so that we can investigate its state. To do this, we have to set a breakpoint, which means set a point in our program where Quorum knows to stop. This is accomplished by either clicking the vertical line where the line numbers are (called the glyph gutter), or by going to the line and using the hotkey (CTRL + F8 or APPLE F8 on Mac). The following is an image of a breakpoint that has been set:
The following is an example of a breakpoint that has been hit:
Debugging Quorum in NetBeans is very similar to debugging in most programming languages. Specifically, when a debug session is started, Netbeans loads new controls, which are in the top bar (as shown in the previous image). These controls and their keyboard shortcuts are named below and their purpose is described.
- Start Debugging (CTRL + F5 or APPLE + F5): Start the debugger
- Stop Debugging (SHIFT + F5): Stop the debugger.
- Pause (no hotkey is available by default): If a Quorum program is currently executing, this will temporarily stop it.
- Continue (F5): If we are stopped at a breakpoint, this will resume execution of the program.
- Step Over(F8): Execute the current line and stop at the next one.
- Step Into (F7): Execute the current line and if the current line contains an action, go inside of that action and stop.
- Step Out (CTRL + F7 or APPLE F7): If we are inside of an action, finish it and stop again when control goes back to whatever component called that action.
- Run to Cursor (F4): Continue the program until it hits the cursor. If the cursor is never hit, the program either runs forever or terminates.
Miscellaneous Shortcut Keys
There are many shortcuts for performing various tasks in Netbeans. Many additional shortcut keys can be found in Oracle's guide to NetBeans' shortcuts
. An incomplete list of additional shortcuts is provided on the Quorum Development Environment
There are several tutorials from which you can choose at this point to learn more about programming in Quorum. We suggest you start with one of the following: