Replacing String Properties

You can use the FindReplace object to replace string properties of an object at run time. The following example uses the FindReplaceInObject method to accomplish this.

The code in this example searches through a group of objects within a picture and changes their data sources by replacing AO with AI.

To search for AO data sources in a picture and replace with them AI data sources:

  1. Insert a Data link and assign Fix32.Thisnode.AO.F_CV as the data source.
  2. Insert a rectangle and animate its HorizontalFillPercentage using AO as the data source.
  3. Now duplicate the rectangle three times.
  4. Select all the rectangles and group them.
  5. Name the group "MyGroup".
  6. Create a Push button. Right-click the Push button and select Edit Script from the pop-up menu.
  7. Enter the following code in the Push button's Click event:

Dim Success As Boolean

FindReplace.FindReplaceInObject MyGroup, 4, "AO", "AI",_

     Success

'The 4 indicates to search through data sources only.

  1. Switch to the run-time environment and click the Push button.

    The FindReplace object searches MyGroup and changes all instances of AO to AI. Because the Data link's data source falls outside of MyGroup, it remains unchanged.

See Also

How Do I...

Important Notice

You do not have the latest version of iFIX! You are missing out on the newest capabilities and enhanced security.

For information on all the latest features, see the iFIX product page.

For more information on upgrades, contact your GE Digital sales agent or e-mail [email protected].

For the most up-to-date documentation, go here.