GAB Code Editor

From GAB Help
Jump to: navigation, search

Contents

Overview

Global Application Builder Editor, allows users to create scripts to run within the Global Shop parameters. Within the Editor there is intellitext to help the user with correct syntax while creating the scripts to be used.

Starting out in the GAB Editor

Menu Items

File

New Project (Ctrl+N) - Adds Treeview on the left of the screen that shows the project name (NewScript#.gas), with Screens and Subs listed below. There will be a “Main” sub listed with every project.

Project

Create a new project.

Subroutine

Create a new subroutine for

Include File

Opens a new Include File. This is a script that can be reused in different programs that are created using the GAB Editor. Include files do not have screens, global variables, other include files, or a main subroutine. They cannot be run independently.

Open (Ctrl+O)

Allows user to open an existing project for modification, It will populate the treeview with screens and subs created in that project.

Save Project (Ctrl+S)

Saves project with current name into the default directory (..\Global\Plugins\GAB\GAS).

Save Project As...

Allows project to be saved with a New name, and into a new directory.

Delete Subroutine

Deletes a subroutine that is no longer used or needed. Select the subroutine in the Tree View and then select delete or press the Delete button on the keyboard.

Copy to GAP
Copy to Distro
5 Scripts opened recently

These are the most recent opened scripts.


Edit

Copy(Ctrl+C)

Copy the selected text.

Paste(Ctrl+P)

Paste the copied text.

Undo (Ctrl+Z)

Undoes the last keystroke

Redo (Ctrl+Y)

Recreates the last keystroke

Comment

Inserts a single quote at the beginning of the current line of code, making it a comment. If multiple lines of code are highlighted, it inserts a single quote at the beginning of each line, commenting the entire block.

Uncomment

Removes a single quote (if present) from the beginning of the current line of code. If multiple lines of code are highlighted, it removes a single quote (if present) from the beginning of each line, uncommenting the entire block.

Indent

Indents the current line of code if nothing is highlighted. Otherwise, indents all highlighted lines of code.

Outdent

Outdents a single line of code if nothing is highlighted. Otherwise, outdents all highlighted lines of code.

Collapse All

Collapse all subroutines.

Expand All

Expands all subroutines.


Tools

Add Include File

Adds an Include File to the script that was created prior to opening the current script. This Launches a Browser to the GAS directory to associate the include file.

Add User Defined Type

Creates a user-defined data type which can contain one or more elements of any type.

Add Global Variable

Creates a Global Variable for the current script to use in the program. An initial value for the global variable can also be set.

Add UDT Global Variable

Creates a global variable with a type of one of the previously created UDTs.

Add Control Structure

Allows you to create commonly used control structures that can easily be added to your code by using Edit – Insert Control Structure. Each structure has a name and is stored in a file called InsertBlock.txt in the Global\Plugins directory. Some control structures should already exist in InsertBlock.txt.

Insert Control Structure (Ctrl+I)

Inserts the selected code block on the current line. Additional control structures can be added through Tools – Add Control Structure. This can only be performed on a blank line. There is an example of how to a control structure in the Tools section of the documentation.

Insert InvokeDebuggers(Ctrl+R)

Inserts Function.Intrinsic.Debug.Stop on the current line. This can only be performed on a blank line.

Insert Breakpoint (Ctrl+B)

Inserts Function.Intrinsic.Debug.Stop on the current line. This can only be performed on a blank line.

Clear All InvokeDebuggers

Removes all instances of Function.Intrinsic.Debug.Stop from the project.

Clear All Breakpoints (Ctrl+D)

Removes all instances of Function.Intrinsic.Debug.Stop from the project.

Project Details
Project Notes Changes
Current Sub Notes Changes
Form Designer

Launches the Forms Designer section for modification of forms.

Sign External GAS File
Setting

Run

Execute (F5)

Executes the current project. You have the option of choosing to run with an existing hook file. You can also enter simulated calling program information including hook number, GS user, terminal, company code, and Global path. You can enable the GAB execution debug and have the GAB Code Editor remember the entered program info values. Please make sure that the Global Path is correct otherwise there are many commands that will no longer work.

Quick Execute (Ctrl+F5)

Executes the current project without prompting for an existing hook file or program information. Previously entered and remembered values will be reused.

Execute Hook File (Shift+F5)
View Last OCTSRS Log

Help

Help (Ctrl+F1)

Launches the GAB Online Help (www.gss-updates.com/site/gabhelpen/gab.htm).

Web Help (Shift+F1)

Launches the GAB Online Help (www.gss-updates.com/site/gabhelpen/gab.htm).

GAB Forum (F2)

Launches the GAB Online Forum (gabforums.globalshopsolutions.com).


Icons

caption

From left to right:

1. New-project-icon.PNG New project

2. New-project-icon.PNG New Subroutine

3. Form-designer-icon.PNG Form designer

4. Wizard-icon.PNG Screen wizard

5. Open-project-icon.PNG Open Project

6. Save-project-icon.PNG Save project

7. Run-project-icon.PNG Run

8. Refresh-project-icon.PNG Refresh project

9. Delete-sub-form-icon.PNG Delete sub or form

10. Project-notes-icon.PNG Project notes

11. Setting-project-icon.PNG Setting


caption

From left to right:

1. Dropdown list for subroutines

2. Copy.png Copy

3. Cut.png Cut

4. Paste.png Paste

5. Undo.png Undo

6. Redo.png Redo

7. Indent.png Indent

8. Outdent.png Outdent

9. Comment.png Comment

10. Uncomment.png Uncomment

11. Find.png Find

12. Format Font

13. Font size


Using the Global Application Builder (GAB)

Editor Tree View

Project

Shows default name newscript#.gas (# changes with each additional new project). Name can be modified with Save Project As, or clicking in the .gas name and making the change. The project includes allscreens, subroutines, include files, and Global Variables.==

Global Variables

These are variables that can be used anywhere within the project.==

Include Files

Allow a user to add code created to be reused to the current project. When added they can not be modified within the current project, but can be modified by opening the include file instead of a new project.==

Screens

Allows screen script to be viewed but not modified, to modify the screens the user must go into the forms designer to make the changes.

Subs

Allows subroutine scripts to modified, will list all available for modification. Subs can be renamed all except for sub Main, every project must have a sub main for scripting to work. ==

Delete Subs

To delete a sub, select the sub in the Tree View, then click on the X in the tool bar or simply click the delete button on the keyboard. Will not delete if the sub code is highlighted on the right hand side of the screen.==

Code/Syntax

Looking at the code within the project each line should show up in multiple colors, the following list shows what each color represents.==

Color - Definition - Example

Green - Identifier - Function

Dark Purple - Subidentifier - ODBC

Dark Red - Nominative - LvwBearing

Light Blue - Subnominative - Rst (in 2nd line above)

Bright Blue - Property/Method - AddListItem

Grey - Sub Property/Method - Part

Purple - Variable - Variable

Grey Blue - Variable Domain - Screen

Orange - Variable Name - Con (in 1st line above)

Pink - Variable Subname - TxtPart

Seagreen - Variable Property/Method - FieldVal

Brown - Variable Sub Property/Method - Part (in 1st line above)

Black - Values

Bright Red - Error - Syntax errors

Light Green - Comments - Text that tells what the script will do at that section.


  • Intellisense dropdown lists will appear as you complete a syntax fragment to remind you of possibilities for the next fragment. Tooltips will also appear to show you the required and the optional arguments for a method.
  • The Gab code editor supports cut (Ctrl-X), copy (Ctrl-C) and paste (Ctrl-V) features.

Setting up a script in GAB Editor

Sub Main is the starting point for the project. Startup calls will happen within the sub Main. Screens can be launched from there, along with calling other subroutines. GAB projects will not be able to run without the sub Main.

Executing a script from the GAB Editor

To launch the project from within the editor simple press the arrow icon (run). The script will not launch properly if the project is tied to a Global Shop screen, meaning that variable.passed.000000 is being used in the project.