Zabaware Support Forums

Zabaware Forums => Ultra Hal 7.0 => Topic started by: tiger8u2 on August 30, 2014, 01:22:16 pm

Title: New Error Message
Post by: tiger8u2 on August 30, 2014, 01:22:16 pm
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:

Code: [Select]

'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?
Title: Re: New Error Message
Post by: onthecuttingedge2005 on August 31, 2014, 01:35:19 pm
common error, it's due to a variable not chosen during the plug-in's selection.
Title: Re: New Error Message
Post by: tiger8u2 on August 31, 2014, 07:38:44 pm
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?