Equinox Online Help - Language Reference - A to Z
ExecuteMacro |
|
---|---|
Applies to | |
Syntax | ExecuteMacro SourceCode [,How] |
Action | [Statement] Allows source code to be written and executed under program control. |
Scope | Usable anywhere |
Notes | The text in SourceCode is compiled and executed as method language at run-time. This enables complex method language to be built up, perhaps according to user input, and then executed. Application uses might be to build up search/ filter statements, or to allow the user to specify at run-time what they want in a report. The optional parameter [,How] can take the following values:
Normally Equinox knows when a method executes which fields will be referred to, and builds a list when the method is saved. In macros, the same process occurs at runtime, before the macro is executed. Equinox creates a list of items that will be referenced, including information about the current record and so on. Normally this information is separate from the list held for the calling method, in a similar way to separate subtable blocks. This means that if you write to fields inside a macro executed with How set to less than two, the field values will not affect those in the calling method. If How is two or greater, Equinox uses the list from the calling method, and so the new values are preserved. However if you try to access fields or workareas which have not been referenced outside the macro, an error will occur, as Equinox is not able to create references to new items inside the macro. |
Category | Flow Control |
See Also | Block_EndBlock, BreakPressed, Continue, Execute, EnableInput, Exit |
Example | The following example shows how a simple filter is created according to user choices. Note also the use of the multi-line string character $...$ memo vMethod |