dupa

Author Topic: New Error Message  (Read 2903 times)

tiger8u2

  • Full Member
  • ***
  • Posts: 190
  • Eat'em and Smile!
    • View Profile
New Error Message
« 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?
« Last Edit: August 30, 2014, 08:20:40 pm by tiger8u2 »

onthecuttingedge2005

  • Guest
Re: New Error Message
« Reply #1 on: August 31, 2014, 01:35:19 pm »
common error, it's due to a variable not chosen during the plug-in's selection.

tiger8u2

  • Full Member
  • ***
  • Posts: 190
  • Eat'em and Smile!
    • View Profile
Re: New Error Message
« Reply #2 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?