Global Script Editor

In this dialog, you can write a script that defines one or more functions. Typically, global scripts define general user functions that need to be called from inside a replication script or an expression script. See Writing a Function to use in Scripts and Expressions for details on how to write and call a global function. For additional examples of useful global script functions, check Global Script Function Examples.

The Global Script Editor provides the following features.

  • Choice of languages for all scripts between VB and C# using the Script Language list at the bottom of the editor.

  • Editing and formatting features that include automatic indentation, automatic coloring for syntax, numeric values, comments, “code folding”, and keyboard shortcuts.

  • Access to the Expression Generator to identify functions and build expressions.

  • Script Compiler

To use the Global Script Editor:

  1. Select the programming language for the script. The default language is Visual Basic, but you can choose C# using the Script Language list at the bottom of the Script Editor.

  2. Type the script into the editor pane.

  3. Use the editor formatting and navigation features to aid in writing and correcting the script.

  4. Use the Expression Generator   as needed to identify functions and syntax that you can use in  the script.

  5. Use Global Script Functions in your script if needed.

  6. Use the Compile button to check your script syntax.
    Any script problems are displayed in a separate dialog.

  7. Correct any syntax errors before attempting to run a replication.

Editor Commands

Checks the script syntax. If you do not do this in the script editor, you may encounter errors when the replication is running.
 

Opens the Expression Generator

Opens the References dialog so that you can add the location of any dlls that you are using from your script. You typically need to add dlls to the References dialog and to the script Imports when they do not belong to the default Microsoft .NET environment

Creates a comment for selected text

 Uncomments selected text

Script Language

Provides a drop-down menu to choose between VB and C# as the language for all scripts and expressions using the Global Script Editor, Replication Script Editor and Expression Generator. The selected language is set in the Syniti DR metadata and used for all scripts associated with the metadata.

Editing and Formatting Features

  • Automatic indentation based on syntax

  • Intelligent code completion options

  • Colors to identify specific code elements: syntax in blue, numeric values in pink and comments in green

  • Code folding where sections of code can be collapsed or expanded for ease of reading. The editor displays a green bar on the left side with +/- signs. Click - to collapse a section of code, and click + to expand a section of code.

  • Common editing operations using keystroke combinations

<SHIFT>Left, Right, Up, Down, Home, End, PageUp, PageDown

Move caret with selection

<CTRL>C
<CTRL>V
<CTRL>X

Copy, paste, cut

<CTRL>A

Select all text

<CTRL>Z,, <CTRL>Y

Undo/Redo

Tab
<SHIFT>Tab

Increase/decrease left indent of selected range

<CTRL>Home
<CTRL>End

Go to first/last char of the text

<SHIFT><CTRL>Home, <SHIFT><CTRL>End

Go to first/last char of the text with selection

<CTRL>U
<SHIFT><CTRL>U

Convert selected text to upper/lower case

<INSERT>

Switch between Insert Mode and Overwrite Mode

<CTRL>Backspace
<CTRL>Del

Remove word left/right

<ALT>Mouse, <ALT><SHIFT>Up, Down, Right, Left

 Enable column selection mode

<ALT>Up
<ALT>Down

 Move selected lines up/down

<SHIFT>Del

Remove current line

<ESC>

Close all opened tooltips, menus and hints

<CTRL>Wheel

Zoom

<CTRL>Up
<CTRL>Down

Scroll Up/Down

<CTRL>NumpadPlus, <CTRL>NumpadMinus
<CTRL>0

 Zoom in, zoom out, no zoom

Opening the Global Script Editor

  • In the Management Center Metadata Explorer, select the metadata for which you want to create a global script.

  • From the right mouse button menu, choose Global Script.

Related Topics
Global Script Functions

Writing Scripts with Visual Basic .NET

Writing a Replication Script

Replication Script Events

Replication Script Properties and Methods