dupa

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - oakie

Pages: [1]
1
Ultra Hal 7.0 / Teaching Hal
« on: May 04, 2003, 06:30:45 pm »
I think there is a bug in this code.

'RESPOND: PROCESS TOPICFOCUS FILES
   'If Hal is currently focusing on a topic, this will read from the appropriate focus file
   'First it tries from a topic file specific to the current user, and if that doesn't
   'produce results it tries a global topic file that is the same for all users
   If TopicFocus > 10 Then
      FocusString = CStr(TopicFocus)
      FocusFileNum = Left(FocusString, Len(FocusString) - 1) & "5"
      If CInt(Right(FocusString, 1)) > 0 And CInt(Right(FocusString, 1)) < 28 Then


'=====this is the original code which i think it is wrong because not linking to grobal file ======
         'HalUserBrain = HalBrain.QABrain(UserSentence, WorkingDir & Trim(UserName) & "focus" & FocusFileNum & ".brn", UserBrainRel)
'================
'======= I think this one is better=======

         HalUserBrain = HalBrain.QABrain(UserSentence, WorkingDir  & "Focus" & FocusFileNum & ".brn", UserBrainRel)
'=============================         
         
         If UserBrainRel > 0 Then  
         
            GetResponse = GetResponse & HalUserBrain & vbCrLf
            If DebugMode = True Then
               DebugInfo = DebugInfo & "A response of relevance " & UserBrainRel & " was found in the current global topic focus file and this response has been used." & vbCrLf  & HalUserBrain
               End If

         End If
      End If
      If CInt(Right(FocusString, 1)) > 0 And CInt(Right(FocusString, 1)) < 28 And UserBrainRel = 0 Then
         HalUserBrain = HalBrain.QABrain(UserSentence, WorkingDir & "focus" & FocusFileNum & ".brn", UserBrainRel)
         If UserBrainRel > 0 Then
            GetResponse = GetResponse & HalUserBrain & vbCrLf
            If DebugMode = True Then
               DebugInfo = DebugInfo & "A response of relevance " & UserBrainRel & " was found in the current user topic focus file and this response has been used." & vbCrLf
               End If
         End If
      End If
   End If

'=======

I use Hal 4.5 free version.
Cheers
oakkie

Pages: [1]