Finding and replacing code strings in scripts

The WinStudio script editor (Edit Form/Global Script dialog box) provides tools to find and optionally replace strings in code.

注意: The Replace feature is disabled when a base form script document tab is selected. For more information, see About the WinStudio script editor.

To find and optionally replace a string in the code:

  1. Click the Find and Replace tab on the far right side of the editor.
    注意: You can also access this tab through the Edit menu, by means of the Find or Replace options.

    We recommend that you "pin" the tab open.

  2. To perform a find-and-replace operation, click on the scroll bar to the right of the Quick Find subtab, and then click Quick Replace .
  3. In the Find what field, enter the string you want to search for.
  4. For a find-and-replace operation, in the Replace with field, enter the string to replace the original string with.
  5. In the Look in field, specify whether you want to search the entire Document or just the current code Selection (code selected by click-and-drag).
  6. Optionally, select one or more Find options.
  7. Optionally, specify a Search type:
    • Normal - This option searches for the Find what text exactly as specified and replaces it with the exact text as entered into the Replace with field.
    • Regular expression - This option uses regular expressions to locate the search text, and uses regular expression replace pattern syntax. This allows for replacements at different matched capture points in the search pattern.

      For more information, see Script regular expression searches.

    • Wildcard - This option uses simple wildcard search patterns to locate the text.

      For more information, see Script search wildcards.

    • Acronym - This option matches a character at the start of a word, and then every capital letter or character following an underscore.

      For example, if you specify fr as the acronym pattern, the search would match the text findR in the word findReplace.

    • Shorthand - This option is similar to the Acronym option but allows any non-whitespace character to be between the search pattern characters. In this case, space characters have a special meaning, in that they match to any whitespace character.

      For example, if you specify fr as the shorthand pattern, the search would match the text for in the word therefore. If you were to specify f r as the shorthand pattern (with a space between the letters), the search would match the text "f this r" in the phrase If this runs

  8. Click the button that corresponds with what you want to do.
相关主题