2021-Jul-02
2021-Jul-02

## 810 Macros

Macros are the fundamental basis for scripting and automation in GHS.  Macros are the programming equivalent of functions.  They are a block of code that can be reused multiple times in the program, with only a single definition.  They can even have inputs.  This tutorial introduces the basic concepts of macros and how to use them in GHS.

#### Homework 811

Homework 811 gives the first practice in GHS macros. You will use the advantages of macros to automate the damage stability analysis. Much of a damage stability analysis involves repeated commands. You will include all these commands in a series of macros. This includes macros to run the damage stability criteria, and to set a new subtitle. The exercise should reduce some of the work required for a damage stability analysis. Download includes homework files and solution.

## 820 Variables

Explains how to create and use variables in GHS.  Covers the two primary data types that get used for variables.

• REAL variables
• STRING variables

The tutorial also explains in detail how to use variables for basic mathematical operations in GHS.  This is fairly important because, unlike other programming languages, GHS does not respect order of operations.  You must be very careful to code your equations into GHS in the correct sequence to manually control the order of operations.  This tutorial provides an example of how to do that.

#### Homework 821

Homework 821 covers how to use GHS variables. This is applied in a further revision to the damage stability analysis. In this revision, you change the subtitle command to accept variables for the header, rather than inputs. This is just one example of how to use GHS variables. The important thing to practice is using GHS variables for mathematics. Simple equations. Be very careful to check the equation results from GHS. Remember that GHS does not follow order of operations. Download includes homework files and solution.

## 830 Flow Control

How to use GHS programming for flow control.  This includes creating loops and using if-then statements for basic decision capability.  Also provides a useful example of how to combine loops with if-then statements to automate a damage stability analysis.

#### Homework 831

Homework 831 covers how to use loops and if-then statements in GHS. This includes a special case that allows you to automate GHS damage stability analyses into a simple set of repeatable commands. Download includes homework files and solution.

## 840 Keyboard Shortcuts

Shows how to create custom keyboard shortcuts in GHS. This is the beginnings of creating your own user interface in GHS.  This tutorial allows you to create your own custom macros and then assign them to custom keyboard mappings.

#### Homework 841

Homework 841 shows you how to use keyboard shortcut keys. This is the first major step to graduating from a GHS user to a GHS developer. You are now writing run files for other people to use. Download includes homework files and solution.

## 850 GHS Templates

Templates in GHS are actually custom user forms.  A GHS template is like a macro.  But instead of defining a command sequence, you are defining a user form to extract user input.  This tutorial covers how to define those user forms.  Also covers some basic user input controls, including the following items.

• Text
• Variable inputs
• Drop down lists
• Part selections
• Execution buttons
• Buttons to close the user form

#### Homework 851

Homework 851 covers how to create custom user forms in GHS. These are actual visual forms with buttons that you can click. This is full blown GHS developer work. Download includes homework files and solution.