Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Miniwindows ➜ Miniwindow error (possibly bigger issue)

Miniwindow error (possibly bigger issue)

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Essidus   (16 posts)  Bio
Date Mon 18 Aug 2008 08:07 PM (UTC)
Message
So far, every attempt I've made at using the miniwindows has come back with this error:

Script error
World: main
Execution of line 1 column 82
Immediate execution
Cannot use parentheses when calling a Sub
Line in error:
world.WindowCreate("test", 0, 0, 300, 300, 12, 0, world.ColourNameToRGB("white"))

It sounds like a deeper issue than the mini window scripting, but I wanted to make sure before I start digging deeper. Currently, I'm coding in VBScript
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Mon 18 Aug 2008 08:14 PM (UTC)
Message
The error is pretty much what it says: you're not supposed to use parentheses when you call a sub in VBScript. :-)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Essidus   (16 posts)  Bio
Date Reply #2 on Mon 18 Aug 2008 08:32 PM (UTC)
Message
*groan* I'm clearly braindead. Sorry for even bothering you guys with this
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 18 Aug 2008 09:00 PM (UTC)

Amended on Mon 18 Aug 2008 09:02 PM (UTC) by Nick Gammon

Message
Just to make it clear what we mean, it should read:


WindowCreate "test", 0, 0, 300, 300, 12, 0, world.ColourNameToRGB("white")


VBscript has this strange syntactical requirement that you must have brackets if you are calling a function (which returns a value) and must not, if you don't.

However it really depends on whether you want the result. WindowCreate returns a status code, so all you really need to do is request it:


status = WindowCreate("test", 0, 0, 300, 300, 12, 0, world.ColourNameToRGB("white"))

If status <> 0 Then
  Note "Problem creating window"
EndIf


If I may suggest, Lua is the recommended language these days, is about the same difficulty to learn as VBscript (not much) and doesn' t have this syntactic problem.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Scarn   (47 posts)  Bio
Date Reply #4 on Mon 25 Aug 2008 09:58 AM (UTC)
Message
status = WindowCreate("test", 0, 0, 300, 300, 12, 0, world.ColourNameToRGB("white"))

If status <> 0 Then
Note "Problem creating window"
EndIf



Where would that be pasted? In a trigger or in a script file?
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #5 on Mon 25 Aug 2008 10:01 PM (UTC)
Message
Put it wherever you want to create the window. A script file or plugin would be the normal place.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,892 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.