Code Window

The Code window is where you write any code associated with your VBA project. You could write code which is executed when the user clicks a button in an iFIX picture, or it could be a part of a procedure library you've written to serve your entire project.

Code Window

Two drop-down lists are located just below the title bar. One drop-down list shows all of the objects referenced in the code module, while the other drop-down list shows the procedures associated with each object.

To display the code window, do any of the following:

  • Right-click an object in the iFIX WorkSpace and select Edit Script from the pop-up menu.
  • Double-click any code element in your application in the Project Explorer, such as modules and class modules.
  • Double-click anywhere on any form in your VBA project or any control on a form.
  • Choose View Code from the VBE window. If you want to view the code for a specific project element, such as a worksheet, be sure you select that element first in the Project Explorer.
  • Choose the Module command from the Insert menu, or right-click the Project Explorer and then choose Insert Module.

Once the Code window is displayed, you can enter your code directly into the window.

To learn more about the Code window, refer to the Help topics within the sections Visual Basic User Interface Help and Visual Basic How-To Topics of the Visual Basic for Applications Help file, or search for the Index keyword "code window".

TIP: Remember, a great way to learn how to use VBA with iFIX is to view the scripts behind all of the Application Toolbar buttons. To view the code behind these buttons, run the Visual Basic Editor and expand the Toolbar (ApplicationToolbar) project in the Project Window.

WARNING: Do not update these files. Doing so may cause the toolbar buttons to stop working properly.

See Also