Author Topic: can't use parenthese to sub, error "NOW SOLVED !!"  (Read 5395 times)

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
can't use parenthese to sub, error "NOW SOLVED !!"
« on: December 17, 2015, 11:00:35 pm »
i am getting a error saying something like , can't use parenthese to sub,  What would cause this in a plug in to give an error like that? does anyone have any idea's? i have been looking through it for any errors i may have made.  >:(
« Last Edit: December 18, 2015, 10:04:19 pm by lightspeed »
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3859
    • View Profile
Re: can't use parenthese to sub, error
« Reply #1 on: December 18, 2015, 05:46:04 am »
Maybe this will help:

When you enclose a procedure's argument list in parentheses, you must use the Call keyword:

Call CreateObject("WScript.Shell").Run("program.bat", 0, True)

If you omit the Call keyword, you must also drop parentheses:

CreateObject("WScript.Shell").Run "program.bat", 0, True

In the world of AI it's the thought that counts!

- Art -

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #2 on: December 18, 2015, 03:51:31 pm »
Okay i have been going over it and found a few mistakes one was in the numbers (case) another was a comma spaced out to far , i have ched the perentheses at both ends of all the sentences to make sure i had them all in place they are all okay i rechecked twice even . also checked all the numbers in cases they were all right , checked them all twice, but am still getting the error. here is the actual error word for word.

HALSCRIPT ERROR 1044 ON LINE 2120 IN COLUMN 55. CANNOT USE PARENTHESES WHEN CALLING SUB,

THE FUNNY thing is , it mentions a line 2120.
and on the uhp file by checking the staus bar it shows at the very bottom the line only goes to 330.


This is a 150 multiple answer plug in.

P.S. I have unchecked all other plug ins .
« Last Edit: December 18, 2015, 03:53:23 pm by lightspeed »
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #3 on: December 18, 2015, 05:07:47 pm »
Well i have been trying now to solve it through elimination , i deleted 10 lines at a time and also changed the random number appropriately. i still kept getting the very same error mentioned above . even down to the last ( first sentence i started with . i see nothing wrong with the lay out of the script :

Hre is the script :

Rem Type=Plugin
Rem Name=what do you want to watch
Rem Author=lightspeed
Rem Host=Assistant

'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()THIS IS A BLANK MULTIPLE QUESTION AND ANSWER PLUG IN TO CREATE PERSONAL PLUG INS FOR HAL CREATED WITH THE HELP OF OTHERS ON THE HAL FORUM BY LIGHTSPEED AKA LONNIE HENSLEY.
lblPlugin(0).Caption = "When the words >< or > any other varience of >< is mentioned the character will say back a conversation response to the user.created ."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub

'*******************************************

Rem PLUGIN: PLUGINAREA7
File = ""
File2 = ""
File3 = ""
File4 = ""


InStr(1, OriginalSentence,"what do you want to watch") > 0 Then


Randomize
Select Case int(rnd()*1)
Case 1
GetResponse = "I don't know, what do you want to watch on tv?"
End Select
HalBrain.ReadOnlyMode = False
End If
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #4 on: December 18, 2015, 06:42:36 pm »
SOMETHING STRANGE GOING ON , after i even deleted the file that was giving me problems , i was still getting the above error . i went into the brain editor  into my angela brain opened it and the files are empty shouldn't it have all the tables etc. ? my angela db shows it's at 107 mb's .

Also i opened my angela brain and checked one of my hybred random talk and it worked just fine , all very strange indeed ! ???
 

onthecuttingedge2005

  • Guest
Re: can't use parenthese to sub, error
« Reply #5 on: December 18, 2015, 07:22:45 pm »
next time you get the error post the Halscript.dbg file with the error issue to debug that line of code..

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #6 on: December 18, 2015, 09:27:44 pm »
HERE YOU GO :
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #7 on: December 18, 2015, 09:30:05 pm »
HERE ARE DIFFERENT PARTS OF THE DE BUG  UP TOP IT TELLS WHAT I ENETERED THE ERROR CODE .
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #8 on: December 18, 2015, 09:31:38 pm »
OTHERS ON DOWN THE LIST.
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #9 on: December 18, 2015, 09:32:40 pm »
MORE
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #10 on: December 18, 2015, 09:38:21 pm »
I HAD TO PUT THIS in sections as pics was to big .
« Last Edit: December 18, 2015, 09:40:10 pm by lightspeed »
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error
« Reply #11 on: December 18, 2015, 09:39:12 pm »
AND THE LAST PART OF THE DEBUG.  I HAD TO PUT THIS in sections as pics was to big . the last is in the brain editor showing a sentence that says something about keeping things short , surely this isn't the error . the randome sentences are to long . seems like i have other plug ins just as long . on the random answers !
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error PROBLEM SOLVED !!!!!
« Reply #12 on: December 18, 2015, 10:03:47 pm »
I finally SOLVED the mystery , plug in errors can drive a person crazy ( with me its a short drive lol ) after i tried the debug area i finally by checking my plug in against other working ones i created finally found the problem . it was one lousy word that was missing !
 
 if InStr(1, OriginalSentence,"what do you want to watch") > 0 Then
ON THE ABOVE SENTENCE I FORGOT TO PUT THE WORD "IF" at the beginning .
 this plug in though was a 150 random sentence response one . what it is , is a personalized movie suggestion based on what movies we have .
WHEW, i am glad i finally got it figured out , thanks anyway for others that was willing to help , i do appreciate it . and if i am ever able to help anyone else somehow , if i can , i will .
 

onthecuttingedge2005

  • Guest
Re: can't use parenthese to sub, error PROBLEM SOLVED !!!!!
« Reply #13 on: December 24, 2015, 08:47:31 pm »
I finally SOLVED the mystery , plug in errors can drive a person crazy ( with me its a short drive lol ) after i tried the debug area i finally by checking my plug in against other working ones i created finally found the problem . it was one lousy word that was missing !
 
 if InStr(1, OriginalSentence,"what do you want to watch") > 0 Then
ON THE ABOVE SENTENCE I FORGOT TO PUT THE WORD "IF" at the beginning .
 this plug in though was a 150 random sentence response one . what it is , is a personalized movie suggestion based on what movies we have .
WHEW, i am glad i finally got it figured out , thanks anyway for others that was willing to help , i do appreciate it . and if i am ever able to help anyone else somehow , if i can , i will .

you should know lightspeed, you can not have a universe without an IF........

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: can't use parenthese to sub, error "NOW SOLVED !!"
« Reply #14 on: December 31, 2015, 11:49:43 am »
oncuttingedge2005 ,  in chaos comes order, "if" it all falls in place lol !  :) ;) but you are right i should have known that , things happen though when working with 150 random sentences and up to 5 or 5 trigger words ... it's called insanity with hair pulling fits sometimes !!  :) ;D