GOTO

[goto xxxx] - Allows you to 'jump' around the script. The label you want to jump to is specified as XXXX. e.g.

...
[goto menu]
...

There are three reserved XXXX options to goto:

abort Jump to the end of the script, do NOT SAVE the answers.
quit Jump to the end of the script, SAVE the answers.
exit Jump to the end and prompt if you want the answers saved.


There may be times where you only want to jump is a criteria is met, there is an optional 'IF' option you can use:

[goto top if &species == feline]
The goto would only take affect if the card you were on related to a cat.

At present you can only use the reserved words available to protocols.

The 'comparisons' you can use are:

== String Equals
!= String NOT the same
= Number Equals to
<> Number Not equal to
>Number Greater Than
>=Number Greater than and equal to
<Number Less Than
<=Number Less than equal to
~String Contains
!~ String Does not contain

Some examples of this:

 # Do NOT run is animal has been seen in last 30 days
 [goto quit if &lastseen < 30 ]

 # Do not run if Farm record
 [goto quit if &rtype == FC ]

# Only run if Insured contains PetPlan
[goto insured if &insured ~ PetPlan ]

# If animal balance is under Credit Limit amount ignore.
[goto quit if &BALANCE < &CLIMIT ] 


Status - Special Case

When looking at the animal status there is a slightly different format, animal status codes are two characters each, if you use the normal ~ for contains you may get weird results e.g. animal status code AABBCC if you are looking for AB then the normal contains (~) will find it AABBCC - it picked up the wrong place.

For status codes use the format:

[goto XXXX %% &status ~ AB]
The %% tells the system to check in chunks of two.


Dates

There may be cases where you want to do a date comparison.

For these examples if there is a backtick (`) it will be taken that the lefthand argument is a date. This will be converted into American format YYYYMMDD and then compared, you do need the primary operand (=<>), so you can do:

[goto quit  if &date1 `> 20100201]     Jump if date after 1st Feb 2010
[goto start &date1 `~ 201002 ]         Jump if Feb 2010