GAB Code Editor v4 Code Editor Tab

From GAB Help
Jump to: navigation, search

< Back to main GAB Code Editor v4 Page

The main editor tab with four open and docked dialog windows

The Code Editor Tab is the main coding interface for GAB Scripts. Though the editor tab is largely unchanged from previous versions, there are a number of new menu options, toolbar items, and dockable windows.

Toolbar and Menu Options


New Project [Ctrl+N] - Starts a new blank project with the default starting code.
Open [Ctrl+O] - Open an existing project with file type .gas, .g2u, .g2c, or .g2p
Save [Ctrl+S] - Save the current project in its current location.
Save As [Ctrl+Shift+S] - Save the current project as a new project name, or in a new location without replacing the original project.
Export G2P as Zip [Ctrl+E]
GAB Code Editor 4 introduces a new file format, G2P. This file can't be modified directly in a text editor, since its contents are encrypted, and it contains multiple files. However, G2P scripts can be exported to a zip file, or imported from multiple files.
Select the "Export G2P as Zip" menu item, and choose a name/location. The file contains the script file (and sig file, if not encrypted) in the root directory. It also contains two folders, include and designer. The include folder contains all of the files that were both included and packaged, while the designer folder contains all of the files that were generated by using layout controls, or by setting the "Picture" property on supported controls.
Import Project
To import several files into a single G2P project, create a folder as described above: The script goes in the root of the folder, any designer files go in a sub-folder called "designer", and any included files in a sub-folder called "include". The Zip format should be the same, except zipped. Make sure that the script is in the ROOT of the zip file, and not a sub-folder.
An important note is that a project must include one script file (gas, g2u, g2c, g2u, lib). Multiple script files, or a project without one, will result in an error. Additional scripts can be included in the "include" directory, but they will not be editable within the GAB Code Editor.
Exit [Alt+F4] - Close the code editor.


Undo\Redo [Ctrl+Z]\[Ctrl+Y] - Undo or Redo the most recent change in the currently focused editor or field.
Cut\Copy\Paste [Ctrl+X]\[Ctrl+C]\[Ctrl+V] - Standard Cut\Copy\Paste functionality for the selected or focused field or editor.
Select All [Ctrl+A] - Selects all text in the currently focused editor or field.
Find\Replace [Ctrl+F] - Opens the Find\Replace Dialog window.
Go To [Ctrl+G] - Opens the Go To Dialog window.
Comment\Uncomment Selected [Ctrl+']\[Ctrl+Shift+'] - Comments or uncomments all the currently selected lines in the active editor.
Increase\Decrease Indent - Adds or removes indentation to all of the currently selected lines in the active editor.
Insert Snippet [Ctrl+I] - Opens the Insert Snippet Dialog window.


Collapse/Expand All [Ctrl+Shift+E]\[Ctrl+E] - Collapses or expands all folding regions (Subroutines and Regions)
Toggle Split/View Direction [Ctrl+T] - Switches the split code view between Horizontal and Vertical
Show Regions Window - An option has been added to launch the new Regions Dialog window.
Show Subroutine Window - An option has been added to launch the new Subroutines Dialog window.


Forms Designer [Shift+F7] - Opens the Forms Designer tab for the opened project.
Add Region [Ctrl+Shift+3] - Opens an input box where you input the new region name, then adds the region at the current cursor location, or around the selected code.
Add Subroutine [Ctrl+M] - Opens an input box where you input the new subroutine name, then adds it to the project.
Add Include File [Ctrl+L] - Opens a file selector where you can specify a .lib file to add as an include file.
Add Web Reference - Focuses the Included Files tab, and adds a new web reference to the Web References grid.
Insert Invoke Debugger [Ctrl+R] - Inserts a line that opens the debugger at that program execution location.
Insert Breakpoint [Ctrl+B] - Inserts a line that pauses execution in the debugger, if the debugger is opened.
Clear All InvokeDebuggers [Ctrl+Shift+R] - Removes all lines that open the debugger.
Clear All Breakpoints [Ctrl+Shift+B] - Removes all lines that pause execution.
Go to Definition [F12] - Moves the cursor and view to the variable or Subroutine declaration whose name matches the name that the cursor was on.


Execute [F5] - Saves and runs the project in the currently active GSS environment.
Stop [Shift+F5] - Stops the currently running project.
Execute Settings - Opens the Execute Settings Dialog window.


Settings - Opens the GAB Code Editor Settings Dialog window.


GAB Help [F1] - Opens the GAB Help wiki page in your browser.
GAB Forums [Shift+F1] - Opens the GAB Forums in your browser.
Send Feedback - Opens the associated Canny page in your browser, if the current user's email address is set up and valid.
Report a Problem - (Beta) Opens the Report a Problem dialog.
About GAB Code Editor - Opens the About Overlay for information about the editor, a changelog, and license information.
Show Log Files - Opens up Windows Explorer to the GAB Code Editor logging directory.

Toolbar Options

The toolbar is split up into two parts: the subroutine/regions bar, and the tools. They can be moved independently, though they will always return to the default location when the program is restarted.

The Subroutine/Regions Bar

This toolbar (Left) has four elements:

  1. Regions Dropdown - This drop-down contains a list of all of the project's Regions, and allows the user to navigate to that region by selecting it in the box.
  2. Add Region Text Box - Allows the user to type a region name, and then hit [Enter] to add a new region at the cursor position, or surrounding the selected code.
  3. Subroutines Dropdown - This drop-down contains a list of all of the project's Subroutines, and allows the user to navigate to that subroutine by selecting it in the box.
  4. Add Subroutine Text Box - Allows the user to type a subroutine name, and then hit [Enter] to add a new subroutine to the project.

In the Add Region/Subroutine boxes, if you click the button or hit [Enter] and the box is empty, a pop-up appears to allow you to type a name.

The Tools Bar

This bar contains shortcuts to frequently used menu options, including:

  1. New Project (with wizard for GSS employees) [Ctrl+N]
  2. Open Project [Ctrl+O]
  3. Save Project [Ctrl+S]
  4. Undo\Redo [Ctrl+Z]\[Ctrl+Y]
  5. Cut\Copy\Paste [Ctrl+X]\[Ctrl+C]\[Ctrl+V]
  6. Comment\Uncomment Code [Ctrl+']\[Ctrl+Shift+']
  7. Increase\Decrease Indent
  8. Open Forms Designer [Shift+F7]
  9. Execute [F5]

Dockable Windows

The following windows are either new, or have been modified to allow them to be docked to the sides of the code editor. The code editor will remember which windows you have open, and restore them the next time you launch the code editor (on the same PC). The dock window arrangement is specific to the type of tab you have open, and not all dockable windows support all tab types. They will disappear and reappear automatically.

  1. Execute Settings Dialog
  2. Find\Replace Dialog
  3. Go To Dialog
  4. Insert Snippet Dialog
  5. Subroutine Dialog
  6. Regions Dialog

Status Bar

Compatibility Layer

GAB has a new compatibility layer to ensure that older scripts look good, while enabling pixel perfect designer layout for newer scripts. Use the dropdown at the bottom left to set the compatibility mode (it will automatically pop up if it hasn't been set).

Target Current [x.x.x.x] - This pulls in the version of OCTSRS that this build of the code editor targets. As long as OCTSRS stays within that major version, it will run without compatibility, but once OCTSRS changes its rendering (4.x, probably), the compatibility for the creation version is used. This is the recommended setting
Target Latest - This disables the compatibility layer for your script, no matter what changes are made in OCTSRS. Major OCTSRS updates could break the layout.
Use compatibility for GAB 2.x - This is for older scripts. The controls will look different, but their placement will be the same as the older runtime, so forms will be laid out properly. This is the default run setting for scripts that do not explicitly set compatibility. These scripts will also not be pixel perfect in the designer. The Dark theme is not available in this mode.


A new "Zoom" control has been added to the status bar that allows you to zoom individual editors and documents.

Active Environment

Next, is the Active Environment selector. If you only have one GSS Menu open, it will just show "Running from CCC" for that menu. If you have multiple menus open, it will enable a dropdown menu, where you can change which is the active environment. When you Execute the script, it will run in the currently active environment.


This shows the current user's license level, and (if different) the license that the current project was saved with.

Project Location

The fully qualified path to the currently opened project (if saved).

Editor Information

On the right hand side, you'll see your cursor's current line and column position, as well as the total lines in your project, and length in characters.

Intellisense Update

On the far right, you'll see a progress bar and label while Intellisense updates. This is not visible unless an update is in process. See the Intellisense page for more details on the Intellisense system.