This is an old revision of the document!
The standard Dana distribution package includes a collection of example programs. Their source code is in the
components/examples/ directory of Dana's home folder. Here's how to run them.
Most of the examples are designed to run by automatically linking all of the necessary components together. From a command-prompt in the examples directory, you can run these by typing commands like:
You can run these programs from a command-prompt that is open in any directory on your computer by typing commands like:
The esher meta-program allows you to adapt systems while they're running. Only the graphical user interface examples are designed to work with esher (though you could easily write the necessary configuration files to support all of the other examples too).
You can run one of the graphical examples by opening a command-prompt in the
components/examples/ directory and typing the command:
dana esher conf_filebrowser.txt
This means that the Dana language interpreter is running the program “esher” and the file
conf_filebrowser.txt is being passed to esher as a parameter. There are two other configuration text files that you can also try for the other graphical examples.
Within esher, the commands
tra are the most commonly used:
pa prints the current list of components in the system
add takes one parameter - the configuration text file describing the component to add to the system - and adds the selected component to the system (see the directory “conf” for possible configuration files; you could for example use the command
tra takes three parameters: the name or index number of the component whose dependency (required interface) you want to re-wire; the name of the required interface of that component that you want to re-wire; and the name or index number of the component to re-wire this dependency to. An example would be
tra App Button 6 - a command which re-wires the dependency called
Button of the component named
App to be connected to the component at index 6 in the list printed by the
rem takes one parameter: the name or index number of the component that you would like to remove from the system. Be careful with this command to avoid removing a component that is currently in use.