summaryrefslogtreecommitdiff
path: root/miralib/manual/27/2
diff options
context:
space:
mode:
Diffstat (limited to 'miralib/manual/27/2')
-rw-r--r--miralib/manual/27/244
1 files changed, 44 insertions, 0 deletions
diff --git a/miralib/manual/27/2 b/miralib/manual/27/2
new file mode 100644
index 0000000..c53c3f0
--- /dev/null
+++ b/miralib/manual/27/2
@@ -0,0 +1,44 @@
+_T_h_e_ _%_i_n_c_l_u_d_e_ _d_i_r_e_c_t_i_v_e_ _(_b_a_s_i_c_ _i_n_f_o_r_m_a_t_i_o_n_)
+
+Suppose the file "mylib.m" contains some Miranda declarations (which
+could be any kind of legal Miranda declaration, eg function definitions,
+type definitions etc). To make these in scope in another script, the
+latter will contain the directive
+ %_i_n_c_l_u_d_e "mylib"
+
+This can come anywhere in the script (there is for example no
+requirement that %_i_n_c_l_u_d_e directives come at the front) but must be at
+top level - you may not place a %_i_n_c_l_u_d_e directive inside a _w_h_e_r_e
+clause. The subject of a %_i_n_c_l_u_d_e directive may itself contain %_i_n_c_l_u_d_e
+directives, and so on (to any reasonable depth).
+
+By default, the names `exported' from an included script are all those
+defined in it at top level, but not those of subsidiary %_i_n_c_l_u_d_e's.
+This can be modified by placing a `%_e_x_p_o_r_t' directive in the included
+script. For a discussion of this and other ways of modifying the effect
+of %_i_n_c_l_u_d_e see the manual section giving a detailed account of the
+library directives.
+
+If the filename in a _%_i_n_c_l_u_d_e directive is enclosed in angle brackets
+instead of string quotes, this is understood to be a pathname relative
+to the miralib directory. So for example putting in your script
+ %_i_n_c_l_u_d_e <ex/matrix>
+brings into scope the definitions exported from the matrix package in
+the Miranda examples directory `ex'. (*See note below.)
+
+Finally, note that that the relationship between includor and includee
+is unsymmetrical. If file A %_i_n_c_l_u_d_e's file B, then the declarations of
+B are visible to A, but not vice versa.
+
+There is a simpler (purely textual) directive
+ %_i_n_s_e_r_t "file"
+which causes the contents of "file" to be substituted for the %_i_n_s_e_r_t
+directive during lexical analysis. This can occur anywhere in a Miranda
+script. See manual section on compiler directives.
+
+------------------------------------------------------------------------
+(*) Note to system administrators: an empty directory `local' is
+provided under the miralib directory, in which you can place additional
+libraries which you wish to make available to all Miranda users at your
+site.
+