Index: functions.tex =================================================================== RCS file: /cvsroot/gretl/gretl/doc/tex/functions.tex,v retrieving revision 1.7 diff -u -r1.7 functions.tex --- functions.tex 21 Jul 2006 21:27:45 -0000 1.7 +++ functions.tex 24 Jul 2006 09:47:39 -0000 @@ -199,9 +199,10 @@ experimental, but here is a walk-through of the process. Start the GUI program and take a look at the ``File, Function files'' menu. -%FIXME: the following text should be rewritten -There should be an item there labeled ``Function packager,'' but it -will probably be disabled: it is enabled only if at least one +This menu contains four items: ``On local machine'', ``On server'', ``Edit +package'', ``New package''. + +The ``New package'' command will return an error message, unless at least one user-defined function is currently loaded in memory. There are several ways to load a function: @@ -216,13 +217,12 @@ probably better composing a function non-interactively. \end{itemize} -After loading a function, look again under ``File, Function files'': the -``Function packager'' should now be enabled --- try it. In the first -dialog you get to select: +After loading a function, try again using the command ``File, Function +files, New package''. In the first dialog you get to select: \begin{itemize} \item One or more public functions to package. -\item Zero or more ``private'' auxiliary functions. +\item Zero or more ``private'' helper functions. \end{itemize} Public functions will be available to users; private functions are @@ -233,6 +233,10 @@ short description). You also get to enter help text for the public interface(s). If there's more than one such interface, you get a drop-down selector that can be used to activate the various interfaces. +You have a last chance to edit the code of the functions to be +packaged, by selecting them from the drop-down selector and clicking on +``Edit function code''. Finally, you can choose to upload the package on +gretl's server as soon as it is saved, by checking the relevant checkbox. Clicking ``OK'' in this dialog leads you to a File Save dialog. All being well, this should be pointing towards a directory named @@ -242,6 +246,9 @@ that is where the program will look in the special routine for opening such files (see below). +Needless to say, the menu command ``File, Function files, Edit package'' +allows you to edit again a local function package. + \vspace{6pt} A word on the file you just saved. By default, it will have a @@ -262,20 +269,25 @@ Why package functions in this way? To see what's on offer so far, try this second phase of the walk-through. -Close gretl, then re-open it. Now go to /File/Open command -file/function file. If the first stage above has gone OK, you should +Close gretl, then re-open it. Now go to ``File, Function files, On +local machine''. If the first stage above has gone OK, you should see the file you packaged and saved, with its short description. If -you click on ``Info'' you get all the information gretl has gleaned -from the function package. If you click on ``Code'' you get a script -view window showing the actual function code. If you click ``Open'' -the functions are loaded; try doing that. +you click on ``Info'' you get a window with all the information gretl +has gleaned from the function package. If you click on the ``View +code'' icon in the toolbar of this new window, you get a script view +window showing the actual function code. Now, back to the ``Function +packages'' window, if you click on the package's name, the functions +are loaded into gretl, ready to be called by clicking on the ``Call'' +button, or by using the CLI. After loading the function(s) from the package, open the GUI console. Try typing \texttt{help foo}, replacing \texttt{foo} with the name of a public interface from the loaded function package: if any help text was provided for the function, it should be presented. -FIXME more needed here. +In a similar way, you can browse and load the functions packages +available on gretl's server, by selecting ``File, Function files, On +server''. %%% Local Variables: %%% mode: latex