Zabaware Support Forums

New Error Message

Started by tiger8u2, August 30, 2014, 01:22:16 PM

Previous topic - Next topic

tiger8u2

OK, new Hal install, only the basic default brain and plug-ins running and I've had the following error happen twice: 

HalScript Error 13 on line 621 in column 30:  Type mismatch: 'CVar'

Here's the script:



'Date Pattern: in # days/weeks/months
    OrigPrefix = HalBrain.SearchPattern(ApptSentence, "* in * days*", 1)
    DateText = HalBrain.SearchPattern(ApptSentence, "* in * days*", 2)
    OrigSuffix = HalBrain.SearchPattern(ApptSentence, "* in * days*", 3)
    If DateText = "" Then
        OrigPrefix = HalBrain.SearchPattern(ApptSentence, "* in * weeks*", 1)
        DateText = HalBrain.SearchPattern(ApptSentence, "* in * weeks*", 2)
        OrigSuffix = HalBrain.SearchPattern(ApptSentence, "* in * weeks*", 3)
    End If
    If DateText = "" Then
        OrigPrefix = HalBrain.SearchPattern(ApptSentence, "* in * months*", 1)
        DateText = HalBrain.SearchPattern(ApptSentence, "* in * months*", 2)
        OrigSuffix = HalBrain.SearchPattern(ApptSentence, "* in * months*", 3)
    End If
    If DateText <> "" Then
        PhraseVal = HalBrain.MakeInt(DateText)
621 -        If PhraseVal = 0 Then PhraseVal = HalBrain.Word2Num(CVar(DateText))
        If PhraseVal > 0 Then
            If InStr(1, ApptSentence, " days", vbTextCompare) Then
                MentionedDate = DateAdd("d", PhraseVal, Date)
            ElseIf InStr(1, ApptSentence, " weeks", vbTextCompare) Then
                MentionedDate = DateAdd("ww", PhraseVal, Date)
            ElseIf InStr(1, ApptSentence, " months", vbTextCompare) Then
                MentionedDate = DateAdd("m", PhraseVal, Date)
            End If
        End If
    End If


I tracked it down to the appointments plug-in.

My input each time the error occured was something like:  "In the last two months...."

Immediately after the error, I got the silent treatment twice, but then Hal responded to a later input.

Anyone else have this happen?

Is this a vbscript bug caused by Windows 7/8?

onthecuttingedge2005

common error, it's due to a variable not chosen during the plug-in's selection.

tiger8u2

Thanks OTCE!  So, if I un-select it and save the script then re-select it, could the variable be updated or can I just go in and force the variable myself using SQLite Studio?