
|
www.edelwise.com |
Product Summary |
|
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. |


|
Other useful links: product FAQ product comparison chart product licensing |
|
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 variables Dim UpdateOk As beWISE.var_INTEGER 'ready event Dim WithEvents KarlSays As beWISE.var_STRING 'commands from KARL Private Sub Form_Load() Dim i As Integer Randomize Set KarlSays = Create.New_var_STRING("KARLtoHANS") Set UpdateOk = Create.New_var_INTEGER("Ready") UpdateOk.Value = 0 '--- we create the list object --- Set 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 Call AllReadings.Create("Reading" & Format(i, "00"), _ Next i End Sub Private Sub KarlSays_Changed() 'commands from KARL Select Case KarlSays.Value Case "Start" Increment.Enabled = True Case "Stop" Increment.Enabled = False End Select End Sub Private Sub Increment_Timer() 'called every 200msec when enabled '--- 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 Wend End If 'end of list reached UpdateOk.Value = UpdateOk.Value + 1 'event for KARL End Sub
Program KARL:
Dim AllReadings As beWISE.obj_LIST 'list with all readings Dim WithEvents UpdateOk As beWISE.var_INTEGER 'ready event Dim TellHans As beWISE.var_STRING 'orders for HANS Private Sub Form_Load() Set TellHans = Create.New_var_STRING("KARLtoHANS") Set UpdateOk = Create.New_var_INTEGER("Ready") '--- create the list object with FILTER = "Reading" --- Set AllReadings = Create.New_obj_LIST("Reading") End Sub Private Sub UpdateOk_Changed() 'HANS tells KARL — ready! Dim i, j As Integer Dim s As String ListBox1.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 s = "" For j = 0 To 9 Step 1 'create one line from 10 values If AllReadings.varIsValid Then s = s & Format(AllReadings.varValue, "00.0 ") AllReadings.FindNext 'get NEXT matching var End If Next j ListBox1.AddItem (s) 'add a line to listbox Next i End If 'end of list reached End Sub Private Sub StartReporting_Click() TellHans.Value = "Start" End Sub Private Sub StopReporting_Click() TellHans.Value = "Stop" 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 |