[ ECLiPSe Prolog Environment built-in.|Group Index| Full Index]

set_flag(+Flag, +Value)

Succeeds if the flag Flag is successfully set to the value Value.

+Flag
Atom.
+Value
Atomic or compound term.

Description

Used to set the environment flag Flag to the value Value. The current value of a flag may be returned using get_flag/2. Refer to the specification of get_flag/2 for details about each of the environment flags.

Fail Conditions

Fails if not successfully set to Value.

Resatisfiable

Yes

Exceptions

(4) Instantiation fault
Flag and/or Value are not instantiated.
(5) Type error
Flag is neither an atom nor a variable.
(5) Type error
Value is not of the expected type.
(6) Range error
Flag and/or Value are out of range.
(30)
Flag is a read-only flag.

Examples


Success:
   set_flag(gc,verbose).
   set_flag(syntax_option, no_blanks).
   set_flag(syntax_option, not nl_in_quotes).


   % The following example will set a new library path

   [eclipse]: get_flag(library_path,Path),
      set_flag(library_path, ["/home/myuser/mylibs" | Path]).

   Path = ["/usr/local/ECLIPSE/lib"]
   yes.

Fail:
   set_flag(statistics, some).

Error:
   set_flag(X,a).                (Error  4)
   set_flag("a",x).              (Error  5)
   set_flag(blah, a).            (Error  6)
   set_flag(gc,fred).            (Error  6)
   set_flag(version,1).          (Error 30)


See Also

get_flag / 2, env / 0, cd / 1, compile / 1, compile / 2, coroutine / 0, dbgcomp / 0, dynamic / 1, nodbgcomp / 0, lib / 1, lib / 2