updating oE load_map


include map.e 
namespace map 
public function load_map(object file_name_p) 

loads a map from a file.

  1. file_name_p : The file to load from. This file may have been created by the save_map function. This can either be a name of a file or an already opened file handle.

Either a map, with all the entries found in file_name_p, or -1 if the file failed to open, or -2 if the file is incorrectly formatted.


If file_name_p is an already opened file handle, this routine will read from that file and not close it. Otherwise, the named file will be opened and closed by this routine.

The input file can be either one created by the save_map function or a manually created or edited text file. See save_map for details about the required layout of the text file.

Example 1:
include std/error.e 
object loaded 
map AppOptions 
sequence SavedMap = "c:\\myapp\\options.txt" 
loaded = load_map(SavedMap) 
if equal(loaded, -1) then 
    crash("Map '%s' failed to open", SavedMap) 
end iF 
-- By now we know that it was loaded and a new map created, 
-- so we can assign it to a 'map' variable. 
AppOptions = loaded 
if get(AppOptions, "verbose", 1) = 3 then 
end if 
See Also:

new, save_map

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu