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 ➜ VBscript ➜ Syntax issues?

Syntax issues?

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


Posted by Madrox   (40 posts)  Bio
Date Mon 14 Aug 2006 05:45 AM (UTC)

Amended on Mon 14 Aug 2006 10:23 PM (UTC) by Madrox

Message
Awsome, it works now. For some reason it didnt for a while, then it just started to. This is great thanks for your help!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 14 Aug 2006 05:53 AM (UTC)
Message
Quote:

world.getvariable ("drink")
world.getvariable ("chp")

dim drink
dim chp


You need to put the variable into something, like this:


dim drink

drink = GetVariable ("drink")


The way you have written it, it gets the variable and just throws it away.

Also, for comparisons you might want to turn it into an integer, like this:


drink = CInt (GetVariable ("drink"))


Otherwise, it is treated as a string, and comparing to things like 200 won't work the way you expect.

- Nick Gammon

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

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Mon 14 Aug 2006 10:23 PM (UTC)
Message
Generally speaking you should reply by making a reply post, not by editing the first post; editing is usually for fixing typos, format errors, etc., not for adding to the discussion. When you edit it's hard to tell where the conversation started, where it is now, etc.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
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.


14,664 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.