Product Summary |

|
www.edelwise.com |
|
Price: $44.95 |
|
If you need more than just a few variables this product may be right for you. It supports over 5,000 variables and LIST objects to manage them. If you want to share a lot of information among applications, but have no need for data streams or serialized data exchange, then this is the right product for you. |




|
Example “Listening”: This example demonstrates how the LIST object can be used to manipulate larger numbers of variables. One program, called HANS, constantly updates 100 readings (variables that receive random numbers). At the same time another program, called KARL, listens in, reads these variables and displays their values in a listbox. HANS works under strict supervision from KARL. I.e. the program KARL tells the program HANS when to start and when to stop updating the variables. It does this using the “KARLtoHANS” variable. On the other hand, HANS informs KARL when all 100 variables have been updated by incrementing the “Ready” variable. When KARL receives a ‘Changed’ event for the “Ready” variable, he reads all 100 readings (all variables that start with “Reading”) and displays their values in the listbox. Multiple instances of KARL.exe can be started simultaneously. Each one will be able to listen in, display the readings and give HANS commands. In fact, also other programs could listen in, read the variables and give HANS commands at the same time. Program HANS:
Dim AllReadings As beWISE.obj_LIST 'list with all readings Dim UpdateOk As beWISE.var_INTEGER 'values-transfered event Dim WithEvents KarlSays As beWISE.var_STRING 'commands from KARL Private Sub Form_Load() Dim i As Integer Randomize KarlSays = Create.New_var_STRING("KARLtoHANS") UpdateOk = Create.New_var_INTEGER("Ready") UpdateOk.Value = 0 '--- we create the list object --- AllReadings = Create.New_obj_LIST() '---- using the LIST object we create 100 vars of type DOUBLE ' The vars we create are "Reading00" thru "Reading99" --- For i = 0 To 99 Step 1 AllReadings.Create("Reading" & Format(i, "00"), _ Next i End Sub Private Sub KarlSays_Changed() Handles KarlSays.Changed Select Case KarlSays.Value 'commands from KARL Case "Start" Increment.Enabled = True 'start update Case "Stop" Increment.Enabled = False 'stop update End Select End Sub Private Sub Increment_Tick(ByVal sender As System.Object, _
'--- here we update ONLY the vars with name "Reading*" ' To do this we set the FILTER to "Reading" --- AllReadings.Filter = "Reading" 'we set the FILTER If AllReadings.FindFirst Then 'now we browse all 'Reading*' While AllReadings.varIsValid 'check for end of the list AllReadings.varValue = Rnd() * 99 'set random value AllReadings.FindNext() 'get NEXT var in list End While End If 'end of list reached UpdateOk.Value += 1 'event for KARL End Sub
Program KARL:
Dim TellHans As beWISE.var_STRING 'commands we give HANS Dim AllReadings As beWISE.obj_LIST 'list with all readings Dim WithEvents UpdateOk As beWISE.var_INTEGER 'ready event Private Sub Form_Load() End Sub Private Sub Form1_Load(ByVal sender As System.Object, _ TellHans = Create.New_var_STRING("KARLtoHANS") 'create VAR UpdateOk = Create.New_var_INTEGER("Ready") 'create VAR '--- create the list object with FILTER = "Reading" --- AllReadings = Create.New_obj_LIST("Reading") 'create LIST End Sub 'HANS tells KARL — ready! Private Sub UpdateOk_Changed() Handles UpdateOk.Changed Dim i, j As Integer Dim s As String ListBox1.Items.Clear() 'clear listbox AllReadings.Filter = "Reading" 'set the FILTER to 'Reading' If AllReadings.FindFirst Then 'if there are variables For i = 0 To 9 Step 1 'read them 10 by 10 s = "" 'one listbox line (10 values) For j = 0 To 9 Step 1 'create listbox line If AllReadings.varIsValid Then 'check for EOL s = s & Format(AllReadings.varValue, "00.0 ") AllReadings.FindNext 'get NEXT matching var End If Next j ListBox1.Items.Add(s) 'add a line to listbox Next i End If 'EOL - all varaibles browsed End Sub Private Sub StartReporting_Click(ByVal sender As System.Object, _ TellHans.Value = "Start" 'Start button was klicked End Sub Private Sub StopReporting_Click(ByVal sender As System.Object, _ TellHans.Value = "Stop" 'Stop button was klicked End Sub |
|
The Essential Resource for Visual Basic Developers |
|
Home | beWISE Features | VB6 Products | VB.NET Products | Tools | FAQ | Project List | User Forum | Legal | About Us |