/* ------------------------------------------------------------------------
  :Program.       OOptions.ced
  :Contents.      Set Oberon options with CEd & OberonPrefs
  :Author.        Franz Schwarz
  :Copyright.     Public Domain
  :History.       v1.0 [fSchwwarz]
  :Version.       $VER: Options 1.0 (25.6.93)
  :Language.      ARexx
  :Translator.    RexxMast
------------------------------------------------------------------------ */

options results

arg option

if option = 'LIBERAL' then liberal = 1; else liberal = 0
address 'rexx_ced'
'status 19'
filename = result
if upper(right(filename,4)) ~= '.MOD' then filename = ''

if filename ~= '' then do
  'status 18' /* changes */
  if result~=0 then save
end



if liberal then do
  if filename ~= '' then filename = 'file "'filename'"'
  address command 'OberonPrefs pubscreen CygnusEdScreen1 settings 965 'filename
end; else do  
  if filename = '' then
    'okay1 Fehler: Dateiname endet nicht auf '"'.mod' !"
  else do      
    fromstr = ''
    'status 21' /* filename w/o path */
    clipname = 'OberonOpts'compress(result)
    opts = GetClip(clipname)
    if opts ~= '' then do
      parse var opts 'c' oberonopts ' l' olinkopts
      fromstr = ' from default oberonopts 'oberonopts' olinkopts 'olinkopts' '
    end
    /* if you quit OberonPrefs with menu item 'quit' or ESC key, the options are cleared: */
    address command 'rxset 'clipname' `OberonPrefs nosavegad 'fromstr,
      ' omakeout settings 965 pubscreen CygnusEdScreen1 file "'filename'"`'
  end
end

