Skip to content

Macros Dialog Box for Reflection HP

HP Terminal > Macro > Macros

Reflection for HP provides macro support using Visual Basic. When you record macros in Reflection or create new macros using the Create button in the Macros dialog box, they are placed in a module called NewMacros. Macros are saved in your Reflection for HP settings file (*.r1w).

In writing and editing Reflection macros using Visual Basic projects you will be working with:

  • Visual Basic features that are common to all Visual Basic applications. These features include the Visual Basic Editor, Basic language programming commands that are common to all Visual Basic implementations.

  • Methods, properties and events that are specific to Reflection for HP sessions and allow you to configure and manipulate these sessions.

Context-sensitive help from the Visual Basic Editor for Reflection for HP commands is provided by an installed Windows Help file. On newer Windows system, support for viewing Windows help (*.hlp) is no longer available by default. See Knowledge Base Article 7021283 for information about how to configure this support.

The Reflection for HP Programming Reference information is also available on the support website here: http://docs.attachmate.com/reflection/14.x/prog-ref/hp-unix-openvms/.

Setting Description
Macro data Use this field to pass information to the macro. Within a macro, use the MacroData property to access this value.
Export Export the selected macro to a macro file.

Macro Files

Macro files are plain text files that provide a way to save simple macros independently of Reflection for HP settings files (*.r1w). Each macro file contains exactly one macro. Macros are limited to a single subroutine; and cannot call other routines or user forms.

Any recorded macro will run successfully as a macro file because all the code in any recorded macro is contained within a single subroutine. However, if you have created another macro (MacroB) that includes a call to your recorded macro (MacroA), MacroB will not run correctly after being exported to a macro file because the code in MacroA is not included in the exported file.

You can create a macro file when you save a recorded macro by setting Destination to Macro File. You can export an existing macro to a macro file using the Macros dialog box Export option.

More information