| !ZapRun - executed when Zap starts up

| Use Dummy Dynamic Areas if available
Set DDA%Present 1
RMEnsure DummyDynamicAreas 0.00 Set DDA%Present 0
If <DDA%Present> Then SetEval Zap$DummyOSVsn <Zap$OSVsn>
If <DDA%Present> Then SetEval Zap$OSVsn 350
Unset DDA%Present

| Claim file types
Set Alias$@RunType_FFF Run ZapCode:ZapRunFile %%*0

| Claim external edits
Set Alias$@EditType_FFF Run <Zap$Dir>.!Run

| Claim linked and embedded objects
Set OLEServer$Type_FFD -N Zap -R /<Zap$Dir>
Set OLEServer$Type_FFF -N Zap -R /<Zap$Dir>

| Set paths for Zap filters
Set ZapFilters$Path <Zap$Dir>.Code.Filters.Code.
Set ZF$Path ZapFilters:
Set ZFHelp$Path <Zap$Dir>.Code.Filters.Docs.

| Set paths for inserts and scripts
Set ZapInserts$Path ZapUser:Inserts.
Set ZapScripts$Path ZapUser:Scripts.

| Default options
| Note: !ZapConfig expects to find 'Set Zap$Templates '
|       at the start of a line in this section.
Set Zap$Keys      ZapUser:Config.Keys.<Zap$Country>
Set Zap$Menus     ZapUser:Config.Menus.<Zap$Country>
Set Zap$Options   ZapUser:Config.!Config
Set Zap$Settings  ZapUser:Config.Settings
Set Zap$ClickSend ZapUser:Config.ClickSend
Set Zap$Templates ZapTemplates:Default

| If you want a custom tileset, uncomment this
|Set Zap$TileSprites ZapTiles:Zap

| ZapUser:Config.Menus should be a directory containing country-named files
| - if the file doesn't exist, try ZapUser:Config.Menus.UK
| - if *that* doesn't exist either, then ZapUser:Config.Menus must be a file
IfThere <Zap$Menus> Then Else SetEval Zap$Menus Zap$Menus LEFT (LEN Zap$Menus - LEN Zap$Country) + "UK"
IfThere <Zap$Menus> Then Else SetEval Zap$Menus Zap$Menus LEFT (LEN Zap$Menus - 3)

| Similarly for ZapUser:Config.Keys...
IfThere <Zap$Keys> Then Else SetEval Zap$Keys Zap$Keys LEFT (LEN Zap$Keys - LEN Zap$Country) + "UK"
IfThere <Zap$Keys> Then Else SetEval Zap$Keys Zap$Keys LEFT (LEN Zap$Keys - 3)