'------------------------------------------------------------------------------------
' POST PROCESS : SAVE STATEMENTPOLITICS BRAIN RESPONSE
'------------------------------------------------------------------------------------
'check personal keyword file
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "KEYWORDPOLITICS.brn") = "TRUE" AND LearningLevel > 1 AND BlockSave <> True THEN
'INITIALIZE VARIABLES
RESPONSE = "" & Trim(UserSentence)
'SAVE STATMENT : for later use
HalBrain.AppendFile WorkingDir & "statementPOLITICS.BRN" & ".brn", RESPONSE
'DEBUG
DebugInfo = DebugInfo & "Hal has THOUGHT ABOUT IT AND SAVED A statementPOLITICS :" & RESPONSE & VbCrLf
ELSE
DebugInfo = DebugInfo & "Hal has THOUGHT ABOUT IT AND NOT SAVED A statementPOLITICS :" & RESPONSE & VbCrLf
END IF
'----------------------------------------------
'------------------------------------------------------------------------------------
'POST PROCESS : SAVE Q&Areligion BRAIN RESPONSE
'------------------------------------------------------------------------------------
'check personal keyword file
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "KEYWORDreligion.brn") = "TRUE" AND HalBrain.TopicSearch(PrevSent, WorkingDir & "KEYWORDreligion.brn") = "TRUE" AND LearningLevel > 1 AND BlockSave <> True THEN
'INITIALIZE VARIABLES
KEYWORD = UCase(PrevSent)
RESPONSE = "" & Trim(UserSentence)
'SAVE q&a paired response
HalBrain.AppendFile WorkingDir & "QAreligion.brn", "@" & RESPONSE & VbCrLf & " " & KEYWORD
'debuG info
DebugInfo = DebugInfo & "Hal has THOUGHT ABOUT IT AND SAVED .qareligion: " & "@" & RESPONSE & VbCrLf & " " & KEYWORD
Else
DebugInfo = DebugInfo & "Hal has decided not to SAVE this .qareligion: " & "@" & RESPONSE & VbCrLf & " " & KEYWORD
End If
'------------------------------------------------------------------------------------
IT DEPENDS on HOW you are saving information to the FILE
IT Could be A Q&A file
OR
It could be A SENTENCE file.
HalBrain.AppendFile IS generally the WAY TO GO...
the HALBRAIN dll (OBJECT) Contains Various FUNCTIONS which use the "FILESYSTEM.OJECT" So if you are Appending to a file Referenced by the SCRIPT with the filesystem OBJECT It would already have been opened by the HALBRAIN.Appendfile FUNCTION.
SO USE the BUILT-IN HALBRAIN.Appendfile FUNCTION. and you should have no problems. REMEMBER the .UHP is only a function IN the MAIN HALBRAIN SCRIPT.