WinStudio

Edit or Create a Script with Visual Studio

The procedures described in this topic apply to form scripts, but the main steps apply equally to global scripts.

WinStudio must be configured to use Visual Studio.

Interactive (Modeless) Editing

To edit or create a script with Visual Studio:

  1. Open a form and enter Design Mode.
  2. On the Edit menu, click  Script Editor.
    If a form script is not defined for the current form, the editor opens a template for a script. Otherwise, the editor opens the form script for the form. The solution name is EditWinStudioScript. The class name is ScriptClass.VB.
  3. Edit the script code.
    We recommend that you build the script. Visual Studio provides a convenient environment for identifying and correcting errors. WinStudio itself does not use the build.
  4. Press CTRL+S to save the script.
  5. Minimize or close the Visual Studio IDE.
    As long as the modeless dialog is up, you can get back to this Visual Studio session, even if you closed the IDE.
  6. (Optional) In the WinStudio dialog box Editing Script in Visual Studio, start a debugging session to test script functionality with WinStudio.
  7. On the WinStudio toolbar, click the Save icon  to save the script to disk.

Modal Editing

To edit or create a script with Visual Studio:

  1. Open a form and enter Design Mode.
  2. On the Edit menu, click Script Editor.
    If a form script is not defined for the current form, the editor opens a template for a script. Otherwise, the editor opens the form script for the form. The solution name is EditWinStudioScript. The class name is ScriptClass.VB.
  3. Edit the script code.
    We recommend that you build the script. Visual Studio provides a convenient environment for identifying and correcting errors. WinStudio itself does not use the build.
  4. Press CTRL+S to save the script.
  5. Close the Visual Studio IDE or minimize it.
  6. (Optional) In the WinStudio dialog box Editing Script in Visual Studio, you can:
  7. To preserve the script in a cache and close the dialog box, click OK.

NOTE: If the Compile source on OK check box is selected and compilation fails, the dialog box remains open and Compile Status shows a failure message. You can fix the compilation errors and click OK again, or you can clear the check box and click OK to preserve the script, including any faulty code.


Related Topics

About Script Names in VB

Understanding Scripts in WinStudio