Varkon application developers manual

Macro programming

A macro is a module of a special type. It is written in MBS and compiled by the MBS compiler. Here is an example:

MACRO MODULE start_editor(STRING file*132 >"Enter filename !");

  os("some_text_editor "+file);

This macro takes a filename as input, then calls the operating system to start a text editor and load the file specified. If you also add a call to this macro in one of your menus you have actually added new functionality to the Varkon user interface. A user will not see the difference between this and functionality provided by the standard system.

In many senses a macro is similar to an ordinary module. An important difference is that a macro does not create a part that is stored in the DB. Also, you can not load a macro to become the active module and edit it interactively. A macro module must be created using the text editor. While ordinary modules themselves make up the model, macros are only used to create it.

  1. Dialog programming
  2. Using macros to create a model
  3. The init, exit and newjob macro
  4. Where should I keep my macros ? Logo

Varkon 1.19D svn # 120M