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 ➜ How do you?

How do you?

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


Posted by David Berthiaume   (202 posts)  Bio
Date Fri 22 Apr 2005 03:28 PM (UTC)
Message
How do you convert a Variable into an Array to import into a script file?
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Fri 22 Apr 2005 06:25 PM (UTC)
Message
Split it up manually, or with a split function, and then join it again to store it to a variable.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by David Berthiaume   (202 posts)  Bio
Date Reply #2 on Sat 23 Apr 2005 03:12 AM (UTC)
Message
codes = Array("^W", "^o", "^^")

That's what I currently have.
What I'd like to be able to do is:
codes = GetVariable("ArrayCodes")

It didn't work when I tried it.
Would this work?
Arraycodes = GetVariable ("ArrayCodes")
codes = Arraycodes
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #3 on Sat 23 Apr 2005 04:52 AM (UTC)
Message
You'd have to use the split and join functions.

SetVariable "variable", join(codes,",")
Will set "variable" with "^W,^o,^^", You may also want to use a carriage return as the delimiter, which will also allow you to use it as a MC array if you'd ever like to (as well as providing peace of mind that you won't ever have a color code of "^," or whatever.

And then to get them, you'd use the same Split function:
Split(GetVariable("variable"),VBCrLf)
Will return the array in variable (provided it was joined with VBCrLf (a carriage return)).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
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.


15,139 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.