Show Contents / Index / Search

Using Predefined Constants

Reflection 2011 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 a Reflection predefined constant, and the second statement uses the numeric equivalent:

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"

Note: This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Attachmate provides this sample code "AS IS" with no warranties.

Using Predefined Constants in Other Applications

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

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





  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 for ReGIS Graphics



Reflection for UNIX and OpenVMS


Related Topics

Error Codes for IBM Terminals

Error Codes for OpenSystems Terminals