home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 1 / AACD01.ISO / AACDprefs < prev    next >
Text File  |  1999-09-06  |  17KB  |  445 lines

  1. /*
  2. Preferences editor for Amiga Active CDs
  3. $VER: AACDprefs 1.3 (26.8.99) by Neil Bothwick
  4. */
  5.  
  6. /* ;;; Initialise */
  7. options results
  8. signal on error
  9. VerStr = sourceline(3)
  10. VerStr = subword(VerStr,2,words(VerStr) - 4)
  11. WinTitle = 'Amiga Active CD preferences'
  12. GuiPort = 'AACDPREFS'
  13. PrgPort = GuiPort'.1'
  14. CDPrefs = 'ENV:AACD.prefs'
  15. IderPrefs = 'ENV:AACDfile.prefs'
  16. DefCDPrefs  = 'CDTools/S/AACD.prefs'
  17. DefIderPrefs  = 'CDTools/S/AACDfile.prefs'
  18. FileTypes = 'IFF GIF JPG PNG ANM MPG PDF SVX WAV S3M XMM MED DBM MOD MP3 MID AGD HTM LHA DEF'
  19. Settings  = 'CPU FPU PPC GFX'
  20. CmdHelp = '"Command for this type of file"'
  21. ArgHelp = '"Arguments for this command\nThe filename will be added to the end.\nUse %s to include the filename somewhere else."'
  22. Filetype.0 = 'AACDfile'
  23. Filetype.1 = 'Directory Opus'
  24.  
  25. MUIA_Menuitem_Shortcut              = 0x80422030
  26. MUIM_Application_AboutMUI           = 0x8042d21d
  27. MUIM_Application_OpenConfigWindow   = 0x804299ba
  28. MUIA_Group_SameHeight               = 0x8042037e
  29. MUIA_Group_SameWidth                = 0x8042b3ec
  30. MUIA_Group_Spacing                  = 0x8042866d
  31. MUIA_Group_Columns                  = 0x8042f416
  32. MUIA_Group_Rows                     = 0x8042b68f
  33. MUIA_Selected                       = 0x8042654b
  34. MUIA_Disabled                       = 0x80423661
  35. MUIA_Application_Author             = 0x80424842
  36. MUIA_Application_Copyright          = 0x8042ef4d
  37. MUIA_Application_Description        = 0x80421fc6
  38. MUIA_Application_Title              = 0x804281b8
  39. MUIA_Application_Version            = 0x8042b33f
  40. /*monitor on 'CON:0/0/600/180/AACDPrefs/CLOSE/AUTO'*/
  41.  
  42. call LoadLib('rexxsupport.library')
  43. call LoadLib('rexxdossupport.library')
  44. call LoadLib('rexxreqtools.library')
  45. ;;;
  46. /* ;;; Create main window */
  47. thisport = openport(PrgPort)
  48. if thisport = 0 then exit
  49. address(GuiPort)
  50. window id MAIN port PrgPort command 'QUIT' title '"'WinTitle'"'
  51. ;;;
  52. /* ;;; Menus */
  53.     menu ID PROJM label 'Project'
  54.         item ID ABOUM port PrgPort command '"ABOUT"' ATTRS MUIA_Menuitem_Shortcut '"?"' label 'About'
  55.         item  port GuiPort command '"method 'MUIM_Application_AboutMUI' 0"' label 'About MUI'
  56.         menu ID SETTM label 'Settings'
  57.             item port PrgPort command '"method 'MUIM_Application_OpenConfigWindow'"' label 'MUI...'
  58.             endmenu
  59.         item ID QUITM port PrgPort command 'QUIT' ATTRS MUIA_Menuitem_Shortcut 'Q' label 'Quit'
  60.         endmenu
  61.     menu ID EDITM label 'Edit'
  62.         item ID RESTM port PrgPort command '"RESTORE"' ATTRS MUIA_Menuitem_Shortcut 'D' label 'Restore to Defaults'
  63.         item ID LASTM port PrgPort command '"LOAD"' ATTRS MUIA_Menuitem_Shortcut 'L' label 'Last saved'
  64.         endmenu
  65. ;;;
  66. /* ;;; Info */
  67.     group id TABS REGISTER LABELS 'Info,System,Filetypes'
  68.         view file 'CDTools/S/AACDprefs.txt'
  69. ;;;
  70. /* ;;; System */
  71.         group ATTRS MUIA_Group_Columns 4
  72.             space HORIZ
  73.             label 'Filetypes'
  74.             cycle id FTYPE help '"Use Directory Opus filetypes\nor AACDfile settings."' labels Filetype.0','Filetype.1
  75.             space HORIZ
  76.             space HORIZ
  77.             label 'CPU'
  78.             cycle id CPU help '"Some functions have CPU optimised versions,\nset this to ensure you get the best options"' labels '68000,68020,68030,68040,68060'
  79.             space HORIZ
  80.             space HORIZ
  81.             label 'FPU'
  82.             cycle id FPU help '"WARNING:\nSelecting this when you do not have an FPU\nmay crash some programs"' labels 'No FPU,FPU'
  83.             space HORIZ
  84.             space HORIZ
  85.             label 'PPC'
  86.             cycle id PPC help '"Type of PPC processor, if fitted"' labels 'None,603,604'
  87.             space HORIZ
  88.             space HORIZ
  89.             label 'Graphics system'
  90.             cycle id GFX help '"Select the type of graphics\nyour Amiga uses"' labels 'AGA,OCS,CyberGraphX,Picasso96'
  91.             space HORIZ
  92.             space HORIZ
  93.             /*
  94.             label 'Summat else'
  95.             cycle id SUMAT help '"I am sure there was something else I\nneeded to include. I suppose I will\nthink of it just after the CD is mastered."' labels 'Option 1,Option 2,Option 3,Option 4'
  96.             space HORIZ
  97.             */
  98.             endgroup
  99. ;;;
  100. /* ;;; Filetypes */
  101.         group id FTABS REGISTER LABELS 'Images,Sounds,Other'
  102. ;;;
  103. /* ;;; Images */
  104.             group ATTRS MUIA_Group_Columns 3
  105.                 label DOUBLE LEFT '\033b\033uFiletype'
  106.                 label DOUBLE LEFT '\033b\033uCommand'
  107.                 label DOUBLE LEFT '\033b\033uArguments'
  108.                 label DOUBLE LEFT 'IFF Picture'
  109.                     popasl ID IFF0 port PrgPort command '"Check %s"' help '"Command to view IFF pictures"'
  110.                     string ID IFF1 help ArgHelp
  111.                 label DOUBLE LEFT 'GIF Picture'
  112.                     popasl ID GIF0 port PrgPort command '"Check %s"' help '"Command to view GIF pictures"'
  113.                     string ID GIF1 help ArgHelp
  114.                 label DOUBLE LEFT 'JPEG Picture'
  115.                     popasl ID JPG0 port PrgPort command '"Check %s"' help '"Command to view JPEG pictures"'
  116.                     string ID JPG1 help ArgHelp
  117.                 label DOUBLE LEFT 'PNG Picture'
  118.                     popasl ID PNG0 port PrgPort command '"Check %s"' help '"Command to view PNG pictures"'
  119.                     string ID PNG1 help ArgHelp
  120.                 label DOUBLE LEFT 'IFF Anim'
  121.                     popasl ID ANM0 port PrgPort command '"Check %s"' help '"Command to view IFF animations"'
  122.                     string ID ANM1 help ArgHelp
  123.                 label DOUBLE LEFT 'MPEG Video'
  124.                     popasl ID MPG0 port PrgPort command '"Check %s"' help '"Command to view MPEG video"'
  125.                     string ID MPG1 help ArgHelp
  126.                 label DOUBLE LEFT 'Adobe PDF'
  127.                     popasl ID PDF0 port PrgPort command '"Check %s"' help '"Command to view Adobe Acrobat PDF files"'
  128.                     string ID PDF1 help ArgHelp
  129.                 space
  130.                 endgroup
  131. ;;;
  132. /* ;;; Sounds */
  133.             group ATTRS MUIA_Group_Columns 3
  134.                 label DOUBLE LEFT '\033b\033uFiletype'
  135.                 label DOUBLE LEFT '\033b\033uCommand'
  136.                 label DOUBLE LEFT '\033b\033uArguments'
  137.                 label DOUBLE LEFT 'IFF Sample'
  138.                     popasl ID SVX0 port PrgPort command '"Check %s"' help '"Command to play IFF samples"'
  139.                     string ID SVX1 help ArgHelp
  140.                 label DOUBLE LEFT 'WAV Sample'
  141.                     popasl ID WAV0 port PrgPort command '"Check %s"' help '"Command to play WAV samples"'
  142.                     string ID WAV1 help ArgHelp
  143.                 label DOUBLE LEFT 'S3M Module'
  144.                     popasl ID S3M0 port PrgPort command '"Check %s"' help '"Command to play S3M modules"'
  145.                     string ID S3M1 help ArgHelp
  146.                 label DOUBLE LEFT 'XM Module'
  147.                     popasl ID XMM0 port PrgPort command '"Check %s"' help '"Command to play XM modules"'
  148.                     string ID XMM1 help ArgHelp
  149.                 label DOUBLE LEFT 'MED Module'
  150.                     popasl ID MED0 port PrgPort command '"Check %s"' help '"Command to play OctaMED modules"'
  151.                     string ID MED1 help ArgHelp
  152.                 label DOUBLE LEFT 'DBM Module'
  153.                     popasl ID DBM0 port PrgPort command '"Check %s"' help '"Command to play DigiBooster modules"'
  154.                     string ID DBM1 help ArgHelp
  155.                 label DOUBLE LEFT 'Other Module'
  156.                     popasl ID MOD0 port PrgPort command '"Check %s"' help '"Command to play other modules"'
  157.                     string ID MOD1 help ArgHelp
  158.                 label DOUBLE LEFT 'MPEG Audio'
  159.                     popasl ID MP30 port PrgPort command '"Check %s"' help '"Command to play MPEG audio"'
  160.                     string ID MP31 help ArgHelp
  161.                 label DOUBLE LEFT 'MIDI'
  162.                     popasl ID MID0 port PrgPort command '"Check %s"' help '"Command to play midi files"'
  163.                     string ID MID1 help ArgHelp
  164.                 space
  165.                 endgroup
  166. ;;;
  167. /* ;;; Others */
  168.             group ATTRS MUIA_Group_Columns 3
  169.                 label DOUBLE LEFT '\033b\033uFiletype'
  170.                 label DOUBLE LEFT '\033b\033uCommand'
  171.                 label DOUBLE LEFT '\033b\033uArguments'
  172.                 label DOUBLE LEFT 'AmigaGuide'
  173.                     popasl ID AGD0 port PrgPort command '"Check %s"' help '"Command to view AmigaGuide documents"'
  174.                     string ID AGD1 help ArgHelp
  175.                 label DOUBLE LEFT 'HTML'
  176.                     popasl ID HTM0 port PrgPort command '"Check %s"' help '"Command to view HTML documents"'
  177.                     string ID HTM1 help ArgHelp
  178.                 label DOUBLE LEFT 'LhA archive'
  179.                     popasl ID LHA0 port PrgPort command '"Check %s"' help '"Command to list LhA archives"'
  180.                     string ID LHA1 help ArgHelp
  181.                 label DOUBLE LEFT 'Default'
  182.                     popasl ID DEF0 port PrgPort command '"Check %s"' help '"Command to show all other file types"'
  183.                     string ID DEF1 help ArgHelp
  184.                 space
  185.                 endgroup
  186.         endgroup
  187.     endgroup
  188. ;;;
  189. /* ;;; Buttons */
  190.     group HORIZ
  191.         button ID SAVE   port PrgPort command '"UsePrefs(1)"' help '"Save the settings to\nyour hard drive"' label 'Save'
  192.         button ID USE    port PrgPort command '"UsePrefs"'  help '"Use the settings for this session"' label 'Use'
  193.         button ID CANCEL port PrgPort command '"Quit"'      help '"Exit without changing the settings"' label 'Cancel'
  194.         endgroup
  195.     endwindow
  196. ;;;
  197. /* ;;; Set application details */
  198. address(GuiPort)
  199. 'application' MUIA_Application_Version VerStr
  200. 'application' MUIA_Application_Author 'Neil Bothwick'
  201. 'application' MUIA_Application_Copyright '© 1999 by Neil Bothwick, Wirenet'
  202. 'application' MUIA_Application_Title 'AACDprefs'
  203. 'application' MUIA_Application_Description 'Search AmigAactive CD, Aminet CD and Aminet index files'
  204. ;;;
  205. /* ;;; Main loop */
  206. call LoadPrefs()
  207. do forever
  208.     call waitpkt(PrgPort)
  209.     packet = getpkt(PrgPort)
  210.     if packet = '0000 0000'x then iterate
  211.     cmd = getarg(packet)
  212.     call reply(packet,0)
  213.     parse var cmd cmd args
  214.     interpret 'call 'cmd'("'args'")'
  215.     end
  216. ;;;
  217. /* ;;; Load prefs */
  218. LoadPrefs:
  219.     /* Load system settings */
  220.     if ~exists(CDPrefs) then do
  221.         CDPrefs = DefCDPrefs
  222.         call ShowMsg('No system settings found, using defaults')
  223.         end
  224.     if ~open(prefs,CDPrefs,'R') then do
  225.         call ShowMsg('Failed to read system preferences file')
  226.         exit
  227.         end
  228.     do until eof(prefs)
  229.         PrefsLine = readln(prefs)
  230.         if PrefsLine = '' then iterate
  231.         if pos(left(PrefsLine,1),';#') > 0 then iterate
  232.         if left(PrefsLine,11) = 'CLASS=HTML2' 0 then iterate
  233.         parse var PrefsLine setting '=' value
  234.         interpret 'cycle id' setting 'label' value
  235.         end
  236.     call close(prefs)
  237.  
  238.     /* Load filetype settings */
  239.     if ~exists(IderPrefs) then do
  240.         IderPrefs = DefIderPrefs
  241.         call ShowMsg('No filetype settings found, using defaults')
  242.         end
  243.     if ~open(prefs,IderPrefs,'R') then do
  244.         call ShowMsg('Failed to read filetype preferences file')
  245.         exit
  246.         end
  247.  
  248.     PrefsLine = readln(prefs)
  249.     setvar CfgVersion PrefsLine
  250.     ClassCount = 0
  251.     UseOpus = 0
  252.  
  253.     do until eof(prefs)
  254.         PrefsLine = readln(prefs)
  255.         if PrefsLine = '' then iterate
  256.         if pos(left(PrefsLine,1),';#') > 0 then iterate
  257.         ClassCount = ClassCount + 1
  258.         PrefsLine = substr(PrefsLine,pos('CLASS=',upper(PrefsLine)) + 6)
  259.         if left(PrefsLine,1) = '"' then parse var Prefsline '"' Class '"' PrefsLine /*Class = substr(PrefsLine,2,pos('"',PrefsLine,2) - 2)*/
  260.         else parse var PrefsLine Class PrefsLine
  261.         PrefsLine = strip(PrefsLine)
  262.         parse var PrefsLine Defn 'ACTION=' Action
  263.         interpret Class'.cmd="'word(Action,1)'"'
  264.         interpret Class'.arg="'subword(Action,2)'"'
  265.         if ClassCount = 1 & upper(Class) = 'DEFAULT' then UseOpus = 1
  266.         end
  267.     call close(prefs)
  268.  
  269.     cycle id FTYPE label Filetype.UseOpus
  270.     popasl ID IFF0 CONTENT IFF_Picture.cmd
  271.     popasl ID GIF0 CONTENT GIF_Picture.cmd
  272.     popasl ID JPG0 CONTENT JPEG_Picture.cmd
  273.     popasl ID PNG0 CONTENT PNG_Picture.cmd
  274.     popasl ID ANM0 CONTENT ANIM.cmd
  275.     popasl ID MPG0 CONTENT MPEG_Video.cmd
  276.     popasl ID PDF0 CONTENT PDF_file.cmd
  277.     string ID IFF1 CONTENT IFF_Picture.arg
  278.     string ID GIF1 CONTENT GIF_Picture.arg
  279.     string ID JPG1 CONTENT JPEG_Picture.arg
  280.     string ID PNG1 CONTENT PNG_Picture.arg
  281.     string ID ANM1 CONTENT ANIM.arg
  282.     string ID MPG1 CONTENT MPEG_Video.arg
  283.     string ID PDF1 CONTENT PDF_file.arg
  284.     popasl ID SVX0 CONTENT IFF_Sample.cmd
  285.     popasl ID WAV0 CONTENT WAV_Sample.cmd
  286.     popasl ID S3M0 CONTENT S3M_Module.cmd
  287.     popasl ID XMM0 CONTENT XM_Module.cmd
  288.     popasl ID MED0 CONTENT MED_Module.cmd
  289.     popasl ID DBM0 CONTENT DBM_Module.cmd
  290.     popasl ID MOD0 CONTENT Module.cmd
  291.     popasl ID MP30 CONTENT MPEG_Audio.cmd
  292.     popasl ID MID0 CONTENT MIDI.cmd
  293.     string ID SVX1 CONTENT IFF_Sample.arg
  294.     string ID WAV1 CONTENT WAV_Sample.arg
  295.     string ID S3M1 CONTENT S3M_Module.arg
  296.     string ID XMM1 CONTENT XM_Module.arg
  297.     string ID MED1 CONTENT MED_Module.arg
  298.     string ID DBM1 CONTENT DBM_Module.arg
  299.     string ID MOD1 CONTENT Module.arg
  300.     string ID MP31 CONTENT MPEG_Audio.arg
  301.     string ID MID1 CONTENT MIDI.arg
  302.     popasl ID AGD0 CONTENT Guide.cmd
  303.     popasl ID HTM0 CONTENT HTML.cmd
  304.     popasl ID LHA0 CONTENT LhA_Archive.cmd
  305.     popasl ID DEF0 CONTENT Default.cmd
  306.     string ID AGD1 CONTENT Guide.arg
  307.     string ID HTM1 CONTENT HTML.arg
  308.     string ID LHA1 CONTENT LhA_Archive.arg
  309.     string ID DEF1 CONTENT Default.arg
  310.  
  311.     return
  312. ;;;
  313. /* ;;; Use prefs */
  314. UsePrefs:
  315.     parse arg sav
  316.  
  317.     /* Save system settings */
  318.     if ~open(prefs,CDPrefs,'W') then call ShowMsg('Failed to save preferences')
  319.     else do
  320.         call writeln(prefs,'# Amiga Active CD preferences - created by AACDprefs' word(sourceline(3),3)'0a'x)
  321.         do i = 1 to words(Settings)
  322.             setting = word(Settings,i)
  323.             cycle id setting
  324.             call writeln(prefs,setting'='result)
  325.             end
  326.         call close(prefs)
  327.         end
  328.  
  329.     /* Save filetype settings */
  330.     do i = 1 to words(FileTypes)
  331.         type = word(FileTypes,i)
  332.         interpret 'popasl ID' type'0'
  333.         interpret type '= result'
  334.         interpret 'string ID' type'1'
  335.         interpret type '= strip('type' result)'
  336.         end
  337.  
  338.     cycle id FTYPE
  339.     UseOpus = (result == 'Directory Opus')
  340.  
  341.     if ~open(prefs,IderPrefs,'W') then call ShowMsg('Failed to save preferences')
  342.     else do
  343.         call writeln(prefs,'# IDer Prefs file - created by AACDprefs' word(sourceline(3),3)'0a'x)
  344.         call writeln(prefs,'# IDer  --  © 1995 Eclipse Software'||'0a'x)
  345.  
  346.         /* Use Opus prefs */
  347.         if UseOpus = 1 then do
  348.             signal off error
  349.             address command 'version >NIL: dopus5.library 55'
  350.             signal on error
  351.             select
  352.                 when RC = 5 then call ShowMsg('Opus filetypes need as least version 5.5 of Directory Opus')
  353.                 when ~show('P','DOPUS.1') then call ShowMsg('You need to be running Directory Opus as\nWorkbench replacement to use Opus filetypes.')
  354.                 otherwise do
  355.                     call writeln(prefs,'CLASS=Default ACTION=dopus_dclick')
  356.                     /* Ensure dopus_dclick is in path */
  357.                     signal off error
  358.                     address command 'which >NIL: dopus_dclick'
  359.                     if RC = 5 then address command 'copy CDTools/dopus_dclick C: clone'
  360.                     signal on error
  361.                     end
  362.                 end
  363.             end
  364.  
  365.         call writeln(prefs,'CLASS=IFF_Picture OFFSET=0,"FORM????ILBM" ACTION='IFF)
  366.         call writeln(prefs,'CLASS=GIF_Picture SUFFIX=.GIF OFFSET=0,"GIF87a" ACTION='GIF)
  367.         call writeln(prefs,'CLASS=JPEG_Picture OFFSET=6,4A464946 ACTION='JPG)
  368.         call writeln(prefs,'CLASS=PNG_Picture OFFSET=0,89504E47 ACTION='PNG)
  369.         call writeln(prefs,'CLASS=ANIM SUFFIX=.ANIM OFFSET=0,"FORM????ANIM" ACTION='ANM)
  370.         call writeln(prefs,'CLASS=MPEG_Video SUFFIX=.MPG ACTION='MPG)
  371.         call writeln(prefs,'CLASS=PDF_file SUFFIX=.PDF OFFSET=0,"%PDF" ACTION='PDF)
  372.         call writeln(prefs,'CLASS=IFF_Sample OFFSET=0,"FORM????8SVX" ACTION='SVX)
  373.         call writeln(prefs,'CLASS=WAV_Sample OFFSET=0,"RIFF????WAVE" ACTION='WAV)
  374.         call writeln(prefs,'CLASS=S3M_Module SUFFIX=.S3M NAME=S3M.#? OFFSET=44,"SCRM" FLAGS=T ACTION='S3M)
  375.         call writeln(prefs,'CLASS=XM_Module SUFFIX=.XM OFFSET=0,"Extended Module:" FLAGS=I ACTION='XMM)
  376.         call writeln(prefs,'CLASS=MED_Module SUFFIX=.MED NAME=MED.#? OFFSET=0,"MMD?" ACTION='MED)
  377.         call writeln(prefs,'CLASS=DBM_Module SUFFIX=.DBM OFFSET=0,"DBM0" ACTION='DBM)
  378.         call writeln(prefs,'CLASS=Module SUFFIX=.MOD NAME=MOD.#? OFFSET=1080,"M.K." FLAGS=T ACTION='MOD)
  379.         call writeln(prefs,'CLASS=MPEG_Audio NAME=(#?.MP3|#?.MP2) FLAGS=I ACTION='MP3)
  380.         call writeln(prefs,'CLASS=MIDI SUFFIX=.MID OFFSET=0,"MThd" ACTION='MID)
  381.         call writeln(prefs,'CLASS=Guide SUFFIX=.GUIDE OFFSET=0,"@database" FLAGS=I ACTION='AGD)
  382.         call writeln(prefs,'CLASS=HTML NAME=(#?.html|#?.htm) OFFSET=0,"<html" FLAGS=I ACTION='HTM)
  383.         call writeln(prefs,'CLASS=HTML2 NAME=(#?.html|#?.htm) OFFSET=0,"<!doctype" FLAGS=I ACTION='HTM)
  384.         call writeln(prefs,'CLASS=LhA_Archive NAME=(#?.LhA|?#.Lzh) OFFSET=2,"-lh?-" ACTION='LHA)
  385.         call writeln(prefs,'CLASS=Default ACTION='DEF)
  386.         call writeln(prefs,'0a'x||'#END')
  387.         call close(prefs)
  388.         end
  389.     if sav = 1 then do
  390.         address command 'copy >NIL:' CDPrefs 'ENVARC:'
  391.         address command 'copy >NIL:' IderPrefs 'ENVARC:'
  392.         end
  393.     call Quit()
  394.     return
  395. ;;;
  396. /* ;;; Show about requester */
  397. About:
  398.     request title '"'WinTitle'"' gadgets '"OK"' string VerStr'by Neil Bothwick\nCreated using MUIRexx 3.0a'
  399.     return
  400. ;;;
  401. /* ;;; Load a library */
  402. LoadLib:
  403.     parse arg library
  404.     if show('L',library) then return
  405.     if ~exists('LIBS:'library) then address command 'copy System/Libs/'library 'LIBS: clone quiet'
  406.     if ~addlib(library,0,-30,0) then call ExitMsg('Failed to load' library||'0a'x||'Make sure you have run InitCD')
  407.     return
  408. ;;;
  409. /* ;;; Check for a circular reference */
  410. Check:
  411.     arg prog
  412.     prog = strip(prog)
  413.     select
  414.         when prog = 'AACDFILE' then call ShowMsg('You cannot use AACDfile here')
  415.         when prog = 'CUCDFILE' then call ShowMsg('You cannot use CUCDfile here')
  416.         when prog = 'IDER' then call ShowMsg('You cannot use IDer here')
  417.         when pos(right(prog,9), '/AACDFILE :AACDFILE') > 0 then call ShowMsg('You cannot use AACDfile here')
  418.         when pos(right(prog,9), '/CUCDFILE :CUCDFILE') > 0 then call ShowMsg('You cannot use CUCDfile here')
  419.         when pos(right(prog,5), '/IDER :IDER') > 0 then call ShowMsg('You cannot use IDer here')
  420.         otherwise nop
  421.         end
  422.     return
  423. ;;;
  424. /* ;;; ShowMsg */
  425. ShowMsg:
  426.     parse arg msg
  427.     'request id MAIN title "'WinTitle'" gadgets "OK" string' msg
  428.     return
  429. ;;;
  430. /* ;;; Error handler */
  431. Error:
  432.     address command 'requestchoice >NIL: "error" "Error' RC 'in line' sigl'" "OK"'
  433.     if RC = 5 then return
  434.     call ShowMsg('Error' RC 'in line' sigl)
  435.     call Quit()
  436.     return
  437. ;;;
  438. /* ;;; Quit */
  439. Quit:
  440.     address(GuiPort)
  441.     'QUIT'
  442.     exit
  443. ;;;
  444.  
  445.