This predicate can be used for opening a standard module containing prolog text and
loading it into memory (the text is compiled while loading). Each module is identified by
an unique name, this name must be supplied as the first argument of this predicate, the
expected type of this argument is an atom. The second argument is a filename enclosed by
single or double quotes.
It is not necessary to specify a relative or absolute path for the file, just the filename
and extension are necessary. The file to open must be located in a folder called
'modules'.
The last opened or created module becomes the active module of the clausebase.
see also: active_module/1 check_singleton/1 close_all_modules/0 close_module/1 consult/0 consult/1 consult/3 create_module/1 create_module/2 ensure_loaded/1 include/1 module/3 module_name/2 modules open_module/0 open_module/1 open_module/3 open_module_search/3 save_module/1 save_module/2 save_module/3 set_active_module/0 set_active_module/1 this_module/3
| Examples | |
| open_standardmodule(m23, "win.txt"). | open the standard module win.txt inside the 'modules' folder with the open-mode read, the module is identified by the name m23 |
| open_standardmodule(23, "win.txt"). | the first argument is not an atom so a type_error(atom, 23) exception is thrown |
| open_standardmodule(m23, "no.txt"). | because the file doesn't exist an existence_error(module_file, "no.txt") exception is thrown |
For information about the exceptions see open_module/3.