Appendix – Lenze VisiWinNet VisiWinNET Smart Benutzerhandbuch

Seite 260

Advertising
background image

Appendix

Scripts
Restrictions in the programming interface of VisiWinNET Smart

6

l

260

SHP−VWNS DE/EN 6.1

A smaller amount of code for a great number of functions (global modules)

The introductory example for switching the background colour of a "VarIn" control
element as a function of the variable value in the chapter "Scripts" can be extended to
several control elements on different forms by using a global code module.

For this, insert a new code module ("Module1") in the project via the context menu of the
"Design" project explorer node. Insert the following function in this code module:

Public Sub SetVarinDataBackColor(ByVal VarIn As VisiWinNET.Forms.VarIn, _
ByVal e As VisiWinNET.DataAccess.ChangeEventArgs)

If e.Value > 50 Then

VarIn.DataBackColor = System.Drawing.Color.Red
Else
VarIn.DataBackColor = System.Drawing.SystemColors.Window
End If
End Sub

The triggering "VarIn" object and the "ChangeEventArgs" object transferred in the Change
event are expected as function parameters.

The call of the function from a Change event thus is reduced to one single line and then
looks like this:

Private Sub VarIn1_Change(ByVal sender As System.Object, _
ByVal e As VisiWinNET.DataAccess.ChangeEventArgs) _
Handles VarIn1.Change
Module1.SetVarinDataBackColor (sender, e)
End Sub

Advantages of the use of the global function:

ƒ

A smaller amount of code during the call

ƒ

Better parameterisation possible (e.g. if the limit value "50" is to be altered
centrally)

6.4.4

Restrictions in the programming interface of VisiWinNET Smart

The programming interface of VisiWinNET

â

Smart has the following restrictions:

ƒ

VisiWinNET

â

Smart does not contain an individual debugger. Errors are either shown

during the creation or result in an exception during runtime. If in especially
persistent cases debugging appears to be inevitable, the CLR debugger (component
of the Microsoft .NET framework SDK 2.0) can be used. For projects below Windows
CE, even this possibility is no longer provided, since the CLR debugger does not
supply remote debugging support.

ƒ

More complex tasks such as the development of individual control element or class
libraries due to the missing comfort functions (control element designer,
organisation of several projects within one solution, debugging during the
development time...) are reserved for the professional programmer. For Visual
Studio the functions mentioned are provided.

Advertising