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

EXIT|EXIT


Here is a handy little trick that simplifies error exits.

In the example below, we would like the error exit from DOING_BETTER to also exit DOING_GOOD because in that case we want to bypass the message COMPLETED DOING GOOD. Instead of managing this with a variable, a slick way to do it is with a double exit.

macro DOING_GOOD
  me doing good
  .DOING_BETTER
  me completed doing good
/

macro DOING_BETTER
  me starting to do even better
  me oops - have to get out of here! | EXIT | EXIT
  me completed doing better
/

.DOING_GOOD

Here is the result:

DOING GOOD
STARTING TO DO EVEN BETTER
OOPS - HAVE TO GET OUT OF HERE!
End of Run File DOGOOD.RF.

You can combine as many EXIT commands as needed to exit multiple levels. If you put more EXITs than there are macros to exit, the extras are simply ignored.

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