1. Introduction 2. Basic Template Structure 3. Variables, Fields, and Run Files 4. Example Run File
Maintained by Creative Systems, Inc.,Creators of GHS.
Click here for information about GHS and other fine marine software.
Template Command Tutorial: Page II
Basic Template Structure
We are going to write a very basic template command.
The first line of this command contains the word TEMPLATE, the name (anything up to eight letters), and the title. The word TEMPLATE can be shortened to TEM, and the title is surrounded by quotation.
TEMPLATE CLRMENU "How to Make Templates"
The next line starts the template body. We'll cover more about the template body later, but for this example we will use a single text field denoted by quotations.
The last line of a template will always be a closing '/'.
"This is part of the template body."
/
The last thing you will want to type in your run file is the execute command to execute your TEMPLATE command; in this case a period followed by the template name:
.CLRMENU
All together, the command and execution should look like this:
TEMPLATE CLRMENU "How to Make Templates"
"This is part of the template body."
/
.CLRMENU
Adding Color
In the following example we are changing the background color and adding more text to our body with different color parameters.
Color is defined by using a standard six-digit hexadecimal RGB value or one of 15 GHS color codes. We are going to demonstrate these colors by matching the color number to the color by displaying all 15 colors on the template.
In GHS, parameters begin with a '/', and are separated by a space. We are going to make the first line's text green using the /COLOR:2 parameter and then make the template background blue using the /BACKCOLOR:1 parameter in the main TEMPLATE command line.
TEMPLATE CLRMENU "How to Make Templates" /BACKCOLOR:1
"This is part of the template body." /COLOR:2
Then we will alter the color for each dialogue field in the body by using the /COLOR:n parameter after the dialogue, where n will be one of each of the 15 color codes.
You will see that each line of the template body starts a new line in the template by comparing the following command and execution to the resulting template:
TEMPLATE CLRMENU "How to Make Templates" /BACKCOLOR:1
"This is part of the template body." /COLOR:2
"1 BLUE" /COLOR:1
"2 GREEN" /COLOR:2
"3 CYAN" /COLOR:3
"4 RED" /COLOR:4
"5 MAGENTA" /COLOR:5
"6 BROWN" /COLOR:6
"7 WHITE" /COLOR:7
"8 GRAY" /COLOR:8
"9 BRIGHT BLUE" /COLOR:9
"10 BRIGHT GREEN" /COLOR:10
"11 BRIGHT CYAN" /COLOR:11
"12 BRIGHT RED" /COLOR:12
"13 BRIGHT MAGENTA" /COLOR:13
"14 YELLOW" /COLOR:14
"15 BRIGHT WHITE" /COLOR:15
/
.CLRMENU
You can also set the following styles on a per field basis: /BACKCOLOR, /GREY, /LEFT, /RIGHT, /CENTER, /BOLD, and /ITALIC.
Template Command Tutorial: Page III
1. Introduction
2. Basic Template Structure
3. Variables, Fields, and Run Files
4. Example Run File
Customer Support
Copyright (C) 2011, Creative Systems, Inc.