GAB Code Editor 1

From GAB Help
Jump to: navigation, search

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.

New 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 Project (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.

New Subroutine

Subroutines contain code for action in a project.

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.

Print

See Below

View

Args

Shows the args listed in the current subroutine in a frame at the bottom left of the screen if this option has been turned on.

Edit

Undo (Ctrl+Z) - Undoes the last keystroke

Redo (Ctrl+Y)

Recreates the last keystroke

Insert Breakpoint (Ctrl+B)

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

Clear All Breakpoints (Ctrl+D)

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

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.

Comment Block

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 Block

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.

Script Version

Sets the script version of the current project. You can manually adjust the version when new revision is needed or you can set it to auto increment on each save. The script version is stored in Preflight.

Format

Font

Sets the font style and size of the code in the GAB Code Editor.

Run

Execute (F8)

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+F8)

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

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.

Refresh (F5)

Refreshes by reloading what is in the existing .gas file, basically removes any changes made since the last save. You can also refresh by pressing the F5 key.

Show Tooltip (Ctrl+T) - This re-launches the tool tip for a line of code.

Editor Debug - Allows users to find where a problem in syntax is occurring on the screen. This should be disabled if you are not debugging a problem with the GAB Code Editor.

Overwrite Backup - Occasionally the program backs up the script to the local Temp directory. This option controls whether the backups are overwritten or date-stamped.

Logging - When checked, creates an octsrs.logging file in the local Temp directory that holds GAB execution logging information.

Review Logging Files - Opens the local Temp directory so the octsrs.logging file can be selected for review.

Forms Designer

Launches the Forms Designer section for modification of forms.

Notepad

Saves the current project and opens it in Notepad. When Notepad is closed, the project (along with any changes made in Notepad) is refreshed back into the GAB Code Editor. This is useful for Find/Replace.

Sign External GAS File

Creates a valid .sig file for a script without loading the .gas file into the GAB Code Editor.

Intellisense

When checked, activates Intellisense

Help

Help (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

Icon new project.jpg - New Project

Icon open existing project.jpg - Open Existing Project (.gas)

Icon save.jpg - Save Project

Icon refresh screen.jpg - Refresh Screen/Script

Icon new subroutine.jpg - New Subroutine

Icon delete subroutine.jpg - Delete Subroutine

Icon designer.jpg - Forms Designer

Icon wizard.jpg - Screen Wizard

Icon notepad.jpg - Notepad

Icon execute script.jpg - Execute Script

Icon indent.jpg - Indent

Icon outdent.jpg - Outdent

Icon comment.jpg - Comment Block

Icon uncomment block.jpg - Uncomment Block

Icon debug.jpg - Line Debugger

Icon gab online help.jpg - GAB Online Help

Icon gab forum.jpg - GAB Forum

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.