Back | Next Lesson

First Sigmac - "Hello World"

A sigmac consists of a series of statements and their flow of execution.  There are many different types of statements to discuss, we'll start with the basics and go from there.

Write It

Open any text editor and type:

001     /* hello.ff     sc      03.15.2000      ARRIS v7.1
002     //hello
003     level 1u
004     ! ' Hello World '
005     
006     exit

Save the file as "hello.ff" in your ARRIS home directory.
Next you will compile & archive your sigmac to test it out (sorry - next lesson).

Heading/Comments (optional)

001     /* hello.ff     sc      03.15.2000      ARRIS v7.1

The syntax slash-asterisk ( /* ) informs the compiler to ignore everything else on this line to the right of the /*.  This is a non-executing comment statement and can appear anywhere in your code.  Sigmac does not require you to bracket your comments as in C.

You'll appreciate comments much more in a year or two, when you have to modify today's work for tomorrow's ARRIS updates.  Even more so, if it is someone else's program.

Command Name

002     //hello

The syntax - double slash ( // ) specifies the command name for your sigmac.  This will be the command name you type in while in ARRIS to execute your sigmac.  This should be the first executing statements.  The name may contain up to 13 characters, consisting of lowercase "a,b,c, .... x,y,z", numbers "0-9", and the underbar "_" character.  It can not begin with a number though.

Tip: A sigmac with the name "ustart" will execute automatically when ARRIS is initiated.

Tip: To maintain sanity, the command name should be reflected in the filename (ff).

Hint #1: Select a 2 or 3 character prefix for your company, being careful not to replicate existing application prefixes on your systems.  I use "scg_".  This will prevent you from inadvertently reprogramming an ARRIS system command.  If you refuse to follow common sense, see hint #2.

Hint #2: While in ARRIS, type the proposed command name you want to use to see if the command name is already in use by an application.  If you still refuse to follow common sense, see hint #3.

Hint #3: Stay out of my shop.

Command Level & Classification (optional)

003     level 1u

The keyword level specifies the priority and classification of your sigmac.  The priority determines how your sigmac will get in ARRIS when your command is executed from the keyboard.  The level designation means nothing when your sigmac is executed internally by another sigmac (not entered through the keyboard).

This statement is optional, the default is 1u.

There are 3 levels of priority:

Level 1 (default) is typically a draw or edit type of command (sal, box, dla, etc.).  Only another level 1 command will terminate it, while allowing levels 2 and 3 to execute their things and return control back to the original level 1 command.

Level 2 is typically a setup type of command (pen, color, line type, etc.).  Only levels 1 or 2 commands will terminate it, while allowing level 3 to execute its thing and return control back to the original level 2 command.

Level 3 is typically a toggle type of command (dsa, xyf, etc.), requiring no user input.  Only levels 1 or 2 commands will terminate it, while allowing other level 3 commands to execute their thing and return control back to the original level 3 command.

The
classification  separates your sigmacs from the system's sigmacThe classification is specified by appending u (default) or s to the level #.  The u refers to user and the s refers to system.  This becomes very important when your have a sigmac with the same name as a system command.

Example:
If I write a user command called "box" (and I already know there is a system command called "box") and then proceed to type in "box" in ARRIS, my "box" command will execute by default.  To force the execution of the system "box" command, I would type in "::box" (preceding it with double colons).

Likewise, when using the "box" command in a sigmac, I could type ":box" or "::box".  The former, would execute the user "box" command (if found, else it will execute the system "box" command) and the latter will force the execution of the system "box" command (even if there is a user "box" command).
Hint: Never classify one of your sigmacs as a system command.  You can really confuse things.

The Body

004     ! ' Hello World '
005
006
     exit

The flow is pretty straight forward here, the statements are executed straight down the list.  We'll discuss the many different types of statements used in the body of the sigmac in greater detail in future lessons.  Not to leave you hanging . . . Sub-Routines

Although not shown in our first example, subroutines follow the last executing statement ('exit' in our example) in the body of your sigmac.  We'll discuss subroutines in detail in a later lesson.

001     /* hello.ff     sc      03.15.2000      ARRIS v7.1
002     //hello
003     level 1u
004     call print_it
005     exit
006     /*** Subroutines ***
007     print_it::
008             ! ' Hello World '
009     return

So now you know the general structure of a sigmac:




That's all for now,
Steve


This lesson was brought to you by SCG consulting. All written materials related to these Sigmac lessons are copyrighted by SCG and intended for personal use only. Any commercial or non-commercial reproduction for public use is prohibited without written consent from SCG.

Back | Next Lesson