Archive for Plex Tips

Search and Replace in CA Plex

Did you know that you can copy and paste Action Diagram code into a text editor such as Notepad or Notepad++.

This simple tip can be a real time saver when editing Action Diagrams in CA Plex.

Once you have the code in a text editor you can perform operations such as search and replace, or even run macros in Notepad++. For example if you need to add a number of new subroutines and want to include the recommended +Subroutine meta variable and associated edit points, you could do the following:

1. Paste the following boilerplate code into a text editor.

ª+1 Sub aaa
ª+2 +++Define Field: FIELDS/+Subroutine
ª+2 Edit Point Start aaa
ª+2 +If Field: FIELDS/+Subroutine
ª+3 Edit Point aaa
ª+2 Edit Point End aaa
ª+2 +++Undefine Field: FIELDS/+Subroutine
@@

2. Open the Search and Replace dialog in the text editor and replace the “aaa” placeholder with the name of your subroutine, e.g. “Process Results”.

ª+1 Sub Process Results
ª+2 +++Define Field: FIELDS/+Subroutine
ª+2 Edit Point Start Process Results
ª+2 +If Field: FIELDS/+Subroutine
ª+3 Edit Point Process Results
ª+2 Edit Point End Process Results
ª+2 +++Undefine Field: FIELDS/+Subroutine
@@

3. Select the code and copy the text.
4. Paste the copied text into your Action Diagram.

subroutine

5. Repeat the steps for any other subroutines you want to add.

Be careful not to modify any of the special characters, e.g. “ª+2” or “@@”.  The code you edit will be parsed by Plex when you paste the text, so it may report any errors if for instance you mistype a field name.

 
 
© 2013 CM First Group - All rights reserved