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 ➜ General ➜ Sub Splitting Problems

Sub Splitting Problems

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


Pages: 1  2 

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #15 on Wed 09 Apr 2003 01:01 AM (UTC)
Message
I had no idea you could set MC variables to boolean values... Now if I only got around to testing whether it's possible to call the main script through world.callplugin, using the world's id... *daydream*
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #16 on Wed 09 Apr 2003 02:06 AM (UTC)

Amended on Wed 09 Apr 2003 02:07 AM (UTC) by Nick Gammon

Message
MUSHclient variables are stored internally as strings, so when you get it back it will be a string (eg. "0") and not a number (eg. 0). However you might use CInt to convert the result from a string to a number.

A quick test shows this works anyway:

/if "0" then world.note "hello" ' displays nothing
/if "1" then world.note "hello" ' displays hello

Thus, you can use "0" or "1" without converting them to 0 and 1. It might be worth noting that vbTrue is actually -1, not 1. However, anything non-zero is considered true.

Which is why, by the way, this would *not* work:

world.setvariable "test", "vbFalse"

if world.GetVariable ("test") then
...
end if

Since the string "vbFalse" is not zero, the code *would* be executed.

However this would be OK:

world.setvariable "test", vbFalse

if world.GetVariable ("test") then
...
end if



- 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.


69,399 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

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.