InfoConnect VBA Guide
Key Concepts / Using Predefined Constants
In This Topic
    Using Predefined Constants
    In This Topic

    InfoConnect frequently uses predefined constants in place of numbers to make macros easier to read. Predefined constants may be used as method arguments, property values, or error codes.

    The last two lines in the following example show equivalent ways to handle errors in IBM sessions. The first statement uses an InfoConnect predefined constant, and the second statement uses the numeric equivalent:

    Using a predefined constant
    Copy Code
    Dim ret As ReturnCode
    ret=ThisIbmScreen.WaitForHostSett(6000, 3000)
    If ret = ReturnCode.ReturnCode_Timeout Then MsgBox "Time out"
    If ret = 4 Then MsgBox "Time out"
    

    Using Predefined Constants in Other Applications

    You can use InfoConnect predefined constants in other applications by selecting the InfoConnect class libraries.

    1. In the Visual Basic Editor, choose Tools > References.
    2. Select the InfoConnect class libraries:

      Attachmate_Reflection_Objects_Framework

      Attachmate_Reflection_Objects

      Attachmate_Reflection_Objects_Emulation_IbmHosts

      Attachmate_Reflection_Objects_Emulation_OpenSystems

    3. To use legacy predefined constants in other applications, select the appropriate class library.

     For this legacy application

     Select this class assembly

     Reflection for IBM

     Reflection

     Reflection  for ReGIS Graphics

     Reflection4COM

     Reflection  for UNIX and OpenVMS

     Reflection2COM