Changing Object Names in Scripts

If you change the name of an object in a script, and then change the name back to its original, you may also change the edit event that is called from that script. iFIX attempts not to use an older name that is already used in a code or global module, but may not always be able to determine which names are valid.

Renaming Objects with Associated Script

By default, if you change the name of an object that has script associated with it, iFIX automatically renames the event name and the references to the object within the script for that object. Therefore, you do not have to explicitly do anything in your scripts to make these objects work.

However, if you are indirectly referencing any object names in a script from another object (for example, setting Rect1.HorizontalPositional from the click event on Oval1), this reference is not renamed.

To rename these references:

  1. In the WorkSpace, perform a Find and Replace to rename all objects. We do not recommend that you use the Include Scripts option in the Find and Replace feature from the Workspace to perform this function. Doing so will replace objects that we are automatically renaming.
  2. In the Visual Basic Editor, perform a Find and Replace to change any specific object references.

NOTE: Renaming objects in the Property Window can greatly affect how your scripts run using VBA. For more information, refer to the Writing Scripts manual.

See Also

How Do I...