[ Development Environment and Global Settings | Reference Manual | Alphabetic 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.
Modes and Determinism
Modules
This predicate is sensitive to its module context (tool predicate, see @/2).
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) out of range
- Flag and/or Value are out of range.
- (30) trying to write a read-only flag
- 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, dynamic / 1, pragma / 1, lib / 1