logo WinWrap®

Azure Web Site with WinWrap® Basic Scripting

WinWrap® Basic is an embedded macro language component available for .NET and COM 32/64 bit Windows applications. The WinWrap® Basic Component is an alternative to Visual Basic for Applications (VBA), ActiveX (e.g. VBScript, JScript, PerlScript, Rexx-based WSH engines and others), and VSTA for this purpose. The WinWrap® Basic Component is compatible with VBA, Sax Basic, VB.NET and Visual Basic 6.0 style scripts.

Create an Azure Scriptable Application

  • Allow users to script your Azure Web Site's object and events
  • Restrict scripting access to a subset classes, methods, properties and events
  • Promote scriptable class members into the scripting language

Azure Web Site Running Example WinWrap® Basic Scripts

Azure Web Site Scripting Host
View live site.
View code on GitHub.

DOTNet.bas - WWB.NET Script Code

Use powerful .NET classes and language features like generic types in scripts safely.

'#Language "WWB.NET" Imports System Imports System.Collections.Generic Dim WithEvents anincident1 As Incident = TheIncident Private Sub anincident1_Started() Handles anincident1.Started anincident1.FilledInBy = ScriptName() Dim alist As List(Of Integer) = New List(Of Integer) Dim rand As Random = New Random() alist.Add(rand.Next(1, 100)) anincident1.Data = String.Format("Random(1, 100) => {0}", alist.Item(0).ToString) anincident1.LogMe() End Sub

ParseError.bas - WWB.NET Script Code

Parse errors are identified by script path and line number.

'#Language "WWB.NET" Dim WithEvents anincident1 As Incident = TheIncident Private Sub anincident1_Started() Handles anincident1.Started anincident1.FilledInBy = ScriptName() ' force a parsing error xyz = 1 End Sub

Parse error response showing script path and line number.

D:\home\site\wwwroot\App_Data\Scripts\ParseError.bas 08: xyz = 1 Expecting a var name.

BlockedParseError.bas - WWB.NET Script Code

Prevent script access to .NET classes like System.Assembly.

'#Language "WWB.NET" Imports System Imports System.Text Dim WithEvents anincident1 As Incident = TheIncident Private Sub anincident1_Started() Handles anincident1.Started anincident1.FilledInBy = ScriptName() Dim sb As New StringBuilder sb.Append("Hello") Dim t As Type = sb.GetType ' force an unsafe parsing error Dim a As Object = t.Assembly End Sub

BlockedRuntimeError.bas - WWB.NET Script Code

Prevent script access to .NET objects at run-time like System.Assembly.

'#Language "WWB.NET" Imports System.Text Dim WithEvents anincident1 As Incident = TheIncident Private Sub anincident1_Started() Handles anincident1.Started anincident1.FilledInBy = ScriptName() Dim sb As New StringBuilder sb.Append("Hello") Dim o As Object = sb.GetType ' force an unsafe runtime error Dim a As Object = o.Assembly End Sub

WinWrap® Basic Scripts are Clear, Concise and Strongly Typed

WinWrap® Basic provides a comprehensive solution to adding scripting to your application. You or your customer can write script code that responds to events fired from objects provided by the application. Scripts are validated for syntactic correctness and all the application has to do is fire the event. This is a great way to script, with the application calling your script code at the appropriate time.

To see the NoUI example click Scripting - Execution and Design.

To see the Sandbox example click Safe Scripting with Sandboxing.

See WinWrap Examples for instructions on how to download and run "Example 6 - AZW Form".

Copyright Polar Engineering, Inc.