Ok, tell the truth, you know it didn't work right, you posted hoping I'd fix the bugs. I'm going to start sending you bills by the syntax error[

] Here is my round 1 fix, I separted the to parts (tell and listen) to keep it easier to debug. It shouldn't matter where you put it in the program (not the end) I have it in the 1700's lines.
'Response to a knock knock joke
PrevUserSenta = Mid(PrevUserSent, 2, 100)
If Instr (1, UserSentence, "Knock knock", VbTextCompare) > 0 Then
GetResponse = "Who is there?"
End If
If Instr (1, PrevSent, "Who is there", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "who?"
HalBrain.AppendFile WorkingDir & "knock_knock.brn", Trim(OriginalSentence)
End If
If Instr (1, PrevSent, " who", VbTextCompare) > 0 And Instr (1, PrevSent, PrevUserSenta, VbTextCompare) > 0 Then
Knock = (Rnd * 100)
If Knock < 25 Then GetResponse = "HAHAHAHAaaaa that's a good one!"
If Knock > 24 And Knock < 50 Then GetResponse = "Ha Ha very funny"
If Knock > 49 And Knock < 75 Then GetResponse = "That was quite amusing"
If Knock > 74 And Knock < 101 Then GetResponse = "That was bad, I wouldn't quit your day job"
HalBrain.AppendFile WorkingDir & "knock_punch.brn", """" & PrevUserSent & """" & "," & Trim(OriginalSentence)
End If
'tell a knock knock joke
If Instr (1, UserSentence, "tell a knock joke", VbTextCompare) > 0 Then
GetResponse = "OK, knock knock"
JokeA = True 'To track when the joke is on or over.
End If
If Instr (1, UserSentence, "who is there", 1) > 0 Then
TellKnock = HalBrain.ChooseSentenceFromFile(WorkingDir & "knock_knock.brn")
GetResponse = TellKnock
End If
If Instr (1, PrevUserSent, "who is there", VbTextCompare) > 0 Then
Submit = HalBrain.AlphaNumericalOnly(PrevSent)
Submit = " " & Submit & " "
KnockPunch = HalBrain.TopicSearch(Submit, WorkingDir & "knock_punch.brn")
JokeA = False
GetResponse = KnockPunch
End If
one additional note, check out knock knock revisited in the programmers group, nice rewrite to allow jokes from a file. I used the "JokeA =" to prevent my joke responses from being saved, you have to add a line under the block learning section add this line:
If JokeA = True Then BlockSave = True
Glenn