VERSION 5.00
Begin VB.Form frmSource 
   Caption         =   "Knowledge Source"
   ClientHeight    =   2910
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4410
   LinkTopic       =   "Form1"
   ScaleHeight     =   2910
   ScaleWidth      =   4410
   StartUpPosition =   3  'Windows ‚ÌŠù’è’l
   Begin VB.CommandButton cmdPut 
      Caption         =   "PUT"
      Height          =   375
      Left            =   3000
      TabIndex        =   9
      Top             =   2400
      Width           =   1215
   End
   Begin VB.TextBox txtVal 
      Height          =   315
      Index           =   1
      Left            =   180
      TabIndex        =   8
      Top             =   2400
      Width           =   2595
   End
   Begin VB.TextBox txtVal 
      BackColor       =   &H8000000F&
      Height          =   315
      Index           =   0
      Left            =   180
      Locked          =   -1  'True
      TabIndex        =   7
      Top             =   2040
      Width           =   2595
   End
   Begin VB.CommandButton cmdGet 
      Caption         =   "GET"
      Height          =   375
      Left            =   3000
      TabIndex        =   6
      Top             =   1980
      Width           =   1215
   End
   Begin VB.TextBox txtVar 
      Height          =   315
      Left            =   240
      TabIndex        =   4
      Text            =   "a.b.c.d"
      Top             =   1260
      Width           =   2595
   End
   Begin VB.TextBox txtBB 
      Height          =   315
      Left            =   240
      TabIndex        =   1
      Text            =   "bb"
      Top             =   540
      Width           =   2595
   End
   Begin VB.CommandButton cmdConnect 
      Caption         =   "CONNECT"
      Height          =   495
      Left            =   3000
      TabIndex        =   0
      Top             =   1080
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "value : "
      Height          =   255
      Index           =   2
      Left            =   240
      TabIndex        =   5
      Top             =   1740
      Width           =   2535
   End
   Begin VB.Label Label1 
      Caption         =   "variable name : "
      Height          =   255
      Index           =   1
      Left            =   240
      TabIndex        =   3
      Top             =   960
      Width           =   2535
   End
   Begin VB.Label Label1 
      Caption         =   "Blackboard (controller name) : "
      Height          =   255
      Index           =   0
      Left            =   240
      TabIndex        =   2
      Top             =   240
      Width           =   2535
   End
End
Attribute VB_Name = "frmSource"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'
' A Simple Knowledge Source
'
Dim caoEng As CaoEngine
Dim caoWs As CaoWorkspace
Dim WithEvents caoCtrl As CaoController
Attribute caoCtrl.VB_VarHelpID = -1
Dim caoVar As CaoVariable

' Initialize
Private Sub Form_Load()

    Set caoEng = New CaoEngine
    Set caoWs = caoEng.Workspaces(0)

End Sub

' Create a blackboard and data
Private Sub cmdConnect_Click()

    Set caoCtrl = caoWs.AddController(txtBB.Text, "CaoProv.Blackboard")
    Set caoVar = caoCtrl.AddVariable(txtVar.Text)

End Sub

' retrieve data from the blackboard
Private Sub cmdGet_Click()

    txtVal(0).Text = caoVar.Value

End Sub

' write data on the blackboard
Private Sub cmdPut_Click()

    caoVar.Value = txtVal(1).Text

End Sub
