SetVariable
Script function

world.SetVariable

DOC_scripting Read about scripting

Type

Method

Summary

Sets the value of a variable

Prototype

long SetVariable(BSTR VariableName, BSTR Contents);

DOC_data_types View list of data type meanings


Description

Sets the contents of a variable. If the named variable already exists the contents are replaced. If the variable doesn't exist it is created. Variables are contained in the "world" configuration, and saved when the world is saved. You can use variables to "remember" data from one session of MUSHclient to the next.


VBscript example

world.SetVariable "MyName", "Nick Gammon"



Jscript example

world.SetVariable("MyName", "Nick Gammon");



PerlScript example

$world->SetVariable("MyName", "Nick Gammon");



Python example

world.SetVariable("MyName", "Nick Gammon")



Lua example

SetVariable ("MyName", "Nick Gammon")



Return value

eInvalidObjectLabel: The variable name is not valid
eOK: The variable contents were set


DOC_errors View list of return code meanings


See Also ...

Topics

DOC_Arrays Arrays
DOC_plugins Plugins
DOC_scripting Scripting
DOC_variables Variables

Functions

FNC_DeleteVariable DeleteVariable (Deletes a variable)
FNC_GetVariable GetVariable (Gets the contents of a variable)
FNC_GetVariableList GetVariableList (Gets the list of variables)

(Help topic: function=SetVariable)

DOC_contents Documentation contents page