Page 1 of 1
Building macros on the fly?
Posted: Tue May 22, 2012 5:48 pm
by rlbrown3
I am trying to recall, but it seems to me that one could build macros for MLwiN on the fly. Meaning, that all commands provided to MLwiN could be written to a file for editing and use as a macro. If this is correct, are commands written when one interacts with the equation window? I am publishing a paper and need to show the code for the models I have built, but do not want to do this graphically (pictures of the various windows). Thanks.
Roger
Re: Building macros on the fly?
Posted: Tue May 22, 2012 10:11 pm
by ChrisCharlton
We have recently been trying to make sure that everything in the graphical interface has a command equivalent, so if you spot anything that should do but doesn't please let us know. To see the macro commands as they are generated you can open the Data Manipulation->Command Interface window and untick "user". You can then select one or more commands from this window and use the Control-C combination to copy the commands to the clipboard, from where they can be pasted into either the built-in macro editor or the text editor of your own choice. This process is described in detail in chapter 8 of the MCMC manual.
You will probably want to edit the generated commands once you have copied them in as the code generated isn't always as readable as if it was written by a human, for example a generated command might list columns c1 c2 c3 c4 whereas a human might have chosen to refer to them as c1-c4 or to use assigned column names rather than numbers. You will also notice a lot of generated commands that will not be necessary for your macro, for example the GUI often automatically issues WSET commands to refresh the displayed windows.