Installing Quorum Studio
Quorum can be used online and offline as we see fit. For learning, using Quorum in the browser is often good enough, whereas for larger or more intense projects (e.g., physics, user interface design), we need to write our code using the desktop application Quorum Studio. On this page, we walk through obtaining the offline version of Quorum inside of Quorum Studio, our Integrated Development Environment (IDE). To do this, we first go to the download page, which contains links and instructions.
Creating a Quorum project
Once we have installed Quorum, we can create a project in Quorum Studio. There are many kinds of templates we can use for Quorum projects and they are categorized as follows:
- General Projects: These projects include either blank files or basic code outlines to run a new program
- Graphics: There are several project templates for graphics, including templates related to games, image sheets, physics, and skyboxes
- LEGO: There are project types for creating LEGO robot projects. All of these project types automatically setup the project to run it on a corresponding LEGO Mindstorms Robot.
- Other: There are other kinds of project templates, including those for creating documentation, connecting to tools over the Internet, creating audio applications or user interfaces, and creating a web server.
These projects are templates and can be adjusted by us after being created however we see fit. 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, first we load Quorum Studio, which looks approximately like this:
Next, we either press COMMAND + N on Mac, CTRL + N on Windows, open the File Menu -> New Project item or press the first button on the toolbar to open the New Project window, which looks like this:
On the left hand side of this window is a tree that categorizes project types and lets us create them. For our purposes, we are going to open Graphics and select “Skybox.” This is an advanced template, but we are choosing it to highlight the types of applications that can be created. As an alternative for those that want audio applications, Other -> Sine Waves or User Interface would be good alternatives.
Running or Debugging a Quorum program
Once we have created a new project, we can use the tree of the project to navigate to a source file and open it. In the case of the skybox template, there are two folders, Skybox, and SourceCode. Our source files, for all projects, are always in the folder named SourceCode, even if we have other media files in the project. Using the normal navigation keys with the keyboard, left, right, up, or down, we can either navigate the tree with the keyboard or use the mouse to open the folder and select (or double click) Main.quorum. Once on the source code window, we can go back to the tree with COMMAND (or CTRL on Windows) + 1 key, then back to the editor with the same keys + 2.
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. The standard hotkey is COMMAND + R on Mac and CTRL + R on Windows. 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 it at a particular point in time. To do this, we have to set a breakpoint, which means set a point in our program where Quorum Studio knows to stop. This is accomplished by either clicking the vertical line where the line numbers are (called the line gutter), or by going to the line and using the hotkey (COMMAND + K on Mac or CTRL + K on Windows). 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 and Running are very similar, except that with debugging we stop a program while it is running in order to inspect it for errors. We highly recommend using the debugger and memorizing the hotkeys, as they can be helpful when quickly investigating our code. The available controls are listed below:
- Start Debugging (CTRL + D or COMMAND + D): Start the debugger
- Stop Debugging (CTRL + E COMMAND + E): Stop the debugger.
- Pause (CTRL + F7): If a Quorum program is currently executing, this will temporarily stop it.
- Continue (CTRL + F8): If we are stopped at a breakpoint, this will resume execution of the program.
- Step Over(CTRL + F9): Execute the current line and stop at the next one.
- Step Into (CTRL + F10): Execute the current line and if the current line contains an action, go inside of that action and stop.
- Step Out (CTRL + F11): 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 (CTRL + F12): Continue the program until it hits the cursor. If the cursor is never hit, the program either runs forever or terminates.
- Toggle Breakpoint (CTRL + K or COMMAND + K): Toggle a breakpoint on or off on a line of code
In the next tutorial, we will discuss Hotkeys, which describes how to use hotkeys inside of Quorum Studio.