General HydroStatics
Ship Stability Software
Command of the Week
(New or interesting aspects of GHS that you may not know about)

STOP


Everyone who uses GHS is familiar with Run files: sequential lists of commands that the program process from top to bottom. These can become quite lengthy and often contain in various places what programmers call bugs, in addition to good, sound logic. In other words, the run does not accomplish exactly what you wanted it to do, and you may be faced with the task of pinpointing where it went wrong. Sometimes it is not obvious, especially when IF statements and MACRO commands are involved.

STOP is a simple diagnostic tool you can insert in a run file. It causes the processing to stop at that point, but unlike the QUIT command it does not cause the program to shut down (unless the program was launched via the run file). You can observe the state of system variables and the extent of the output, which may give you the evidence you need to correct the "problem" (another euphemism programmers use instead of calling it human error).

After the program has stopped, type VARIABLES (or simply V) to see the current values of system variables as well as any variables you have created. Or use the MESSAGE command to see the contents of a particular variable, for example,

  TANK DB123 | ME {LOAD}
shows the current load setting in the tank DB123.

If you want to use reporting commands in your investigation, first spawn a preview of the report then discontinue the report file. Now you can issue commands like STATUS without affecting the report, which is primary evidence in itself.

If you put more than one STOP in your run file, they should be distinguished by including something else after the word, like STOP 1.

A nice refinement of this technique is to make yourself a STOP macro. For example,

 MACRO STOP
  `EXIT
   IF "{REPFILE}"<>"" THEN PRINT PREVIEW /SPAWN
   REPORT OFF
   STOP %1
 /
Then you would include a dot before the STOP, like .STOP 1. An advantage of doing it this way is that you can remove multiple stops simply by deleting the comment character(`) in front of the EXIT.

The END command is not generally as effective as STOP. The END command signals that the run file is to end, but if you are using macros, it does not terminate the macro that is currently being executed.

STOP has aliases such as HALT and equivalents like STANS and DETENER and ARRESTO and any other command that is not a command.


Questions, comments, or requests?
Contact Creative Systems, Inc.

support@ghsport.com

USA phone: 360-385-6212 Fax: 360-385-6213
Office hours: 7:00 am - 4:00 pm Pacific Time, Monday - Friday

Mailing address:
PO Box 1910
Port Townsend, WA 98368 USA

www.ghsport.com

Click here for an index to this and previous COWs