Walnut/Advanced Topics/E Properties File

From Erights

(Difference between revisions)
Jump to: navigation, search
(E Properties File)
Line 6: Line 6:
<pre>
<pre>
-
<nowiki>pragma.syntax('0.9')</nowiki>
+
<nowiki>pragma.syntax("0.9")</nowiki>
def ehomePath := (interp.getProps()) ["e.home"]
def ehomePath := (interp.getProps()) ["e.home"]
</pre>
</pre>
The properties are stored in a map which can be accessed in the usual manner. For a complete listing of the information in the props.txt file, open yours up and take a look.
The properties are stored in a map which can be accessed in the usual manner. For a complete listing of the information in the props.txt file, open yours up and take a look.

Revision as of 05:40, 27 December 2006


E Properties File

E installations include the props.txt properties file, chock full of information that is occasionally useful. You can access it through the interp object. In this example, we get the home directory for the E installation, which can be useful if you wish to store data in a known location to be shared by multiple E programs:

pragma.syntax("0.9")
def ehomePath := (interp.getProps()) ["e.home"]

The properties are stored in a map which can be accessed in the usual manner. For a complete listing of the information in the props.txt file, open yours up and take a look.

Personal tools
more tools