This directive ensures that the Prolog text being prepared for execution will include the Prolog text denoted by the term argument. When multiple directives ensure_loaded(P_text) exist for the same Prolog text, that Prolog text is included only once.
see also: active_module/1 close_all_modules/0 close_module/1 consult/0 consult/1 consult/3 create_module/1 create_module/2 discontiguous/1 dynamic/1 dynamic/2 import/1 import/2 import_module/1 import_module/2 include/1 initialization/1 module/3 module_name/2 modules multifile/1 not_redo/1 open_module/0 open_module/1 open_module/3 open_module_search/3 open_standard_module/2 private/0 private/1 public/0 public/1 save_module/1 save_module/2 save_module/3 set_active_module/0 set_active_module/1 this_module/3
| Examples | |
| ensure_loaded('c:\\Prolog Files\\Trinc\\Trinc-Prolog\\modules\\win.txt'). | when this directive is encountered while loading a Prolog text then the file 'win.txt' of Trinc-Prolog is also loaded |
| ensure_loaded('..\\Mymodules\\do.txt'). | when this predicate is encounterd the location of the file being prepared is combined with the specified relative path to load the file 'do.txt' |